Class: BentleyMcIlroy::Block

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

Overview

0..b-1, b..2b-1, 2b..3b-1, …

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text, position) ⇒ Block

Returns a new instance of Block.



9
10
11
12
# File 'lib/bentley_mcilroy.rb', line 9

def initialize(text, position)
  @text = text
  @position = position
end

Instance Attribute Details

#positionObject (readonly)

Returns the value of attribute position.



7
8
9
# File 'lib/bentley_mcilroy.rb', line 7

def position
  @position
end

#textObject (readonly)

Returns the value of attribute text.



7
8
9
# File 'lib/bentley_mcilroy.rb', line 7

def text
  @text
end

Instance Method Details

#hashObject



14
15
16
# File 'lib/bentley_mcilroy.rb', line 14

def hash
  RollingHash.new.hash(text)
end