Class: Ragel::Bitmap::ArrayGeneric

Inherits:
Object
  • Object
show all
Defined in:
lib/ragel/bitmap.rb

Instance Method Summary collapse

Constructor Details

#initialize(*strings) ⇒ ArrayGeneric

Returns a new instance of ArrayGeneric.



88
89
90
# File 'lib/ragel/bitmap.rb', line 88

def initialize(*strings)
  @strings = strings
end

Instance Method Details

#[](idx) ⇒ Object



92
93
94
95
96
97
98
# File 'lib/ragel/bitmap.rb', line 92

def [](idx)
  shift = @strings.length * 8
  @strings.inject(0) do |product, bitmap|
    shift -= 8
    product | (bitmap.getbyte(idx) << shift)
  end
end