Class: Mirah::Transform::Transformer::JMetaPosition

Inherits:
Object
  • Object
show all
Defined in:
lib/mirah/transform/transformer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_colObject

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_lineObject

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_offsetObject

Returns the value of attribute end_offset.



46
47
48
# File 'lib/mirah/transform/transformer.rb', line 46

def end_offset
  @end_offset
end

#endposObject

Returns the value of attribute endpos.



47
48
49
# File 'lib/mirah/transform/transformer.rb', line 47

def endpos
  @endpos
end

#fileObject

Returns the value of attribute file.



46
47
48
# File 'lib/mirah/transform/transformer.rb', line 46

def file
  @file
end

#start_colObject

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_lineObject

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_offsetObject

Returns the value of attribute start_offset.



46
47
48
# File 'lib/mirah/transform/transformer.rb', line 46

def start_offset
  @start_offset
end

#startposObject

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