Class PLRuby::BitString
In: plruby.rb
Parent: Object

The class PLRuby::BitString implement the PostgreSQL type bit and bit varying

Methods

&   +   <<   <=>   >>   []   []=   ^   concat   each   from_string   include?   index   length   new   octet_length   push   to_i   to_s   |   ~  

Included Modules

Comparable Enumerable

Public Class methods

create a new BitString object with nbits bits

init can be a Fixnum or a String

For a String the first character can be ‘x’, ‘X’ for and hexadecimal representation, or ‘b’, ‘B’ for a binary representation. The default is a binary representation

Public Instance methods

AND operator

Concatenate self and other

LEFT SHIFT operator

comparison function for 2 BitString objects

All bits are considered and additional zero bits may make one string smaller/larger than the other, even if their zero-padded values would be the same.

RIGHT SHIFT operator

Element reference with the same syntax that for a String object

Return a BitString or a Fixnum 0, 1

  bitstring[fixnum]
  bitstring[fixnum, fixnum]
  bitstring[range]
  bitstring[regexp]
  bitstring[regexp, fixnum]
  bitstring[string]
  bitstring[other_bitstring]

Element assignment with the same syntax that for a String object

  bitstring[fixnum] = fixnum
  bitstring[fixnum] = string_or_bitstring
  bitstring[fixnum, fixnum] = string_or_bitstring
  bitstring[range] = string_or_bitstring
  bitstring[regexp] = string_or_bitstring
  bitstring[regexp, fixnum] = string_or_bitstring
  bitstring[other_str] = string_or_bitstring

XOR operator

append other to self

iterate other each bit

return true if other is included in self

return the position of other in self

return nil if other is not included in self

return the length of self in bits

return the length of self in octets

append other to self

convert self to a Fixnum

convert self to a String

OR operator

NOT operator

[Validate]