Class: Ast::Merge::FreezeNodeBase::Location
- Inherits:
-
Struct
- Object
- Struct
- Ast::Merge::FreezeNodeBase::Location
- Defined in:
- lib/ast/merge/freeze_node_base.rb
Overview
Simple location struct for compatibility with AST nodes
Instance Attribute Summary collapse
-
#end_line ⇒ Object
Returns the value of attribute end_line.
-
#start_line ⇒ Object
Returns the value of attribute start_line.
Instance Method Summary collapse
-
#cover?(line) ⇒ Boolean
Check if a line number is within this location.
Instance Attribute Details
#end_line ⇒ Object
Returns the value of attribute end_line
88 89 90 |
# File 'lib/ast/merge/freeze_node_base.rb', line 88 def end_line @end_line end |
#start_line ⇒ Object
Returns the value of attribute start_line
88 89 90 |
# File 'lib/ast/merge/freeze_node_base.rb', line 88 def start_line @start_line end |
Instance Method Details
#cover?(line) ⇒ Boolean
Check if a line number is within this location
92 93 94 |
# File 'lib/ast/merge/freeze_node_base.rb', line 92 def cover?(line) (start_line..end_line).cover?(line) end |