Class: CodeModels::SourcePosition

Inherits:
Object
  • Object
show all
Defined in:
lib/codemodels/source_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(begin_point = nil, end_point = nil) ⇒ SourcePosition

Returns a new instance of SourcePosition.



77
78
79
80
# File 'lib/codemodels/source_info.rb', line 77

def initialize(begin_point=nil,end_point=nil)
	@begin_point = begin_point
	@end_point = end_point
end

Instance Attribute Details

#begin_pointObject

Returns the value of attribute begin_point.



75
76
77
# File 'lib/codemodels/source_info.rb', line 75

def begin_point
  @begin_point
end

#end_pointObject

Returns the value of attribute end_point.



75
76
77
# File 'lib/codemodels/source_info.rb', line 75

def end_point
  @end_point
end

Instance Method Details

#==(other) ⇒ Object



96
97
98
# File 'lib/codemodels/source_info.rb', line 96

def ==(other)
	self.eql?(other)
end

#begin_column=(column) ⇒ Object



87
88
89
90
# File 'lib/codemodels/source_info.rb', line 87

def begin_column=(column)
	@begin_point=SourcePoint.new unless @begin_point
	@begin_point.column = column
end

#begin_line=(line) ⇒ Object



82
83
84
85
# File 'lib/codemodels/source_info.rb', line 82

def begin_line=(line)
	@begin_point=SourcePoint.new unless @begin_point
	@begin_point.line = line
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


92
93
94
# File 'lib/codemodels/source_info.rb', line 92

def eql?(other)
	other.begin_point==begin_point && other.end_point==end_point
end