Class: BentleyMcIlroy::Block
- Inherits:
-
Object
- Object
- BentleyMcIlroy::Block
- Defined in:
- lib/bentley_mcilroy.rb
Overview
0..b-1, b..2b-1, 2b..3b-1, …
Instance Attribute Summary collapse
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
- #hash ⇒ Object
-
#initialize(text, position) ⇒ Block
constructor
A new instance of Block.
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
#position ⇒ Object (readonly)
Returns the value of attribute position.
7 8 9 |
# File 'lib/bentley_mcilroy.rb', line 7 def position @position end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
7 8 9 |
# File 'lib/bentley_mcilroy.rb', line 7 def text @text end |
Instance Method Details
#hash ⇒ Object
14 15 16 |
# File 'lib/bentley_mcilroy.rb', line 14 def hash RollingHash.new.hash(text) end |