Class: Line::Matchers::Index
- Inherits:
-
Object
- Object
- Line::Matchers::Index
- Includes:
- Helpers
- Defined in:
- lib/line/matchers/index.rb
Instance Attribute Summary collapse
-
#index ⇒ Object
Returns the value of attribute index.
Instance Method Summary collapse
-
#initialize(index) ⇒ Index
constructor
A new instance of Index.
- #inspect(parent = false) ⇒ Object
- #matches?(line, positive_index, negative_index) ⇒ Boolean
Methods included from Helpers
Constructor Details
#initialize(index) ⇒ Index
Returns a new instance of Index.
10 11 12 |
# File 'lib/line/matchers/index.rb', line 10 def initialize(index) self.index = index end |
Instance Attribute Details
#index ⇒ Object
Returns the value of attribute index.
8 9 10 |
# File 'lib/line/matchers/index.rb', line 8 def index @index end |
Instance Method Details
#inspect(parent = false) ⇒ Object
18 19 20 |
# File 'lib/line/matchers/index.rb', line 18 def inspect(parent=false) inspect_helper parent, index.to_s, false end |
#matches?(line, positive_index, negative_index) ⇒ Boolean
14 15 16 |
# File 'lib/line/matchers/index.rb', line 14 def matches?(line, positive_index, negative_index) positive_index == index || negative_index == index end |