Class: Ast::Merge::AstNode::Location
- Inherits:
-
Struct
- Object
- Struct
- Ast::Merge::AstNode::Location
- Defined in:
- lib/ast/merge/ast_node.rb
Overview
Simple location struct for nodes that don’t have a native location object
Instance Attribute Summary collapse
-
#end_column ⇒ Object
Returns the value of attribute end_column.
-
#end_line ⇒ Object
Returns the value of attribute end_line.
-
#start_column ⇒ Object
Returns the value of attribute start_column.
-
#start_line ⇒ Object
Returns the value of attribute start_line.
Instance Method Summary collapse
-
#cover?(line_number) ⇒ Boolean
Check if a line number falls within this location.
Instance Attribute Details
#end_column ⇒ Object
Returns the value of attribute end_column
20 21 22 |
# File 'lib/ast/merge/ast_node.rb', line 20 def end_column @end_column end |
#end_line ⇒ Object
Returns the value of attribute end_line
20 21 22 |
# File 'lib/ast/merge/ast_node.rb', line 20 def end_line @end_line end |
#start_column ⇒ Object
Returns the value of attribute start_column
20 21 22 |
# File 'lib/ast/merge/ast_node.rb', line 20 def start_column @start_column end |
#start_line ⇒ Object
Returns the value of attribute start_line
20 21 22 |
# File 'lib/ast/merge/ast_node.rb', line 20 def start_line @start_line end |
Instance Method Details
#cover?(line_number) ⇒ Boolean
Check if a line number falls within this location
24 25 26 |
# File 'lib/ast/merge/ast_node.rb', line 24 def cover?(line_number) line_number >= start_line && line_number <= end_line end |