Class: Mirah::Transform::Transformer::JMetaPosition
- Inherits:
-
Object
- Object
- Mirah::Transform::Transformer::JMetaPosition
- Defined in:
- lib/mirah/transform/transformer.rb
Instance Attribute Summary collapse
-
#end_col ⇒ Object
Returns the value of attribute end_col.
-
#end_line ⇒ Object
Returns the value of attribute end_line.
-
#end_offset ⇒ Object
Returns the value of attribute end_offset.
-
#endpos ⇒ Object
Returns the value of attribute endpos.
-
#file ⇒ Object
Returns the value of attribute file.
-
#start_col ⇒ Object
Returns the value of attribute start_col.
-
#start_line ⇒ Object
Returns the value of attribute start_line.
-
#start_offset ⇒ Object
Returns the value of attribute start_offset.
-
#startpos ⇒ Object
Returns the value of attribute startpos.
Instance Method Summary collapse
- #+(other) ⇒ Object
-
#initialize(startpos, endpos) ⇒ JMetaPosition
constructor
A new instance of JMetaPosition.
Constructor Details
#initialize(startpos, endpos) ⇒ JMetaPosition
Returns a new instance of JMetaPosition.
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/mirah/transform/transformer.rb', line 49 def initialize(startpos, endpos) @startpos = startpos @endpos = endpos @file = startpos.filename @start_line = startpos.line @start_offset = startpos.pos @start_col = startpos.col @end_line = endpos.line @end_offset = endpos.pos @end_col = endpos.col end |
Instance Attribute Details
#end_col ⇒ Object
Returns the value of attribute end_col.
47 48 49 |
# File 'lib/mirah/transform/transformer.rb', line 47 def end_col @end_col end |
#end_line ⇒ Object
Returns the value of attribute end_line.
46 47 48 |
# File 'lib/mirah/transform/transformer.rb', line 46 def end_line @end_line end |
#end_offset ⇒ Object
Returns the value of attribute end_offset.
46 47 48 |
# File 'lib/mirah/transform/transformer.rb', line 46 def end_offset @end_offset end |
#endpos ⇒ Object
Returns the value of attribute endpos.
47 48 49 |
# File 'lib/mirah/transform/transformer.rb', line 47 def endpos @endpos end |
#file ⇒ Object
Returns the value of attribute file.
46 47 48 |
# File 'lib/mirah/transform/transformer.rb', line 46 def file @file end |
#start_col ⇒ Object
Returns the value of attribute start_col.
47 48 49 |
# File 'lib/mirah/transform/transformer.rb', line 47 def start_col @start_col end |
#start_line ⇒ Object
Returns the value of attribute start_line.
46 47 48 |
# File 'lib/mirah/transform/transformer.rb', line 46 def start_line @start_line end |
#start_offset ⇒ Object
Returns the value of attribute start_offset.
46 47 48 |
# File 'lib/mirah/transform/transformer.rb', line 46 def start_offset @start_offset end |
#startpos ⇒ Object
Returns the value of attribute startpos.
47 48 49 |
# File 'lib/mirah/transform/transformer.rb', line 47 def startpos @startpos end |
Instance Method Details
#+(other) ⇒ Object
61 62 63 |
# File 'lib/mirah/transform/transformer.rb', line 61 def +(other) JMetaPosition.new(@startpos, other.endpos) end |