Class: CFG::Location
- Inherits:
-
Object
- Object
- CFG::Location
- Defined in:
- lib/CFG/config.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
Returns the value of attribute column.
-
#line ⇒ Object
Returns the value of attribute line.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(line = 1, column = 1) ⇒ Location
constructor
A new instance of Location.
- #next_line ⇒ Object
- #to_s ⇒ Object
- #update(other) ⇒ Object
Constructor Details
#initialize(line = 1, column = 1) ⇒ Location
Returns a new instance of Location.
149 150 151 152 |
# File 'lib/CFG/config.rb', line 149 def initialize(line = 1, column = 1) @line = line @column = column end |
Instance Attribute Details
#column ⇒ Object
Returns the value of attribute column.
143 144 145 |
# File 'lib/CFG/config.rb', line 143 def column @column end |
#line ⇒ Object
Returns the value of attribute line.
142 143 144 |
# File 'lib/CFG/config.rb', line 142 def line @line end |
Class Method Details
Instance Method Details
#==(other) ⇒ Object
168 169 170 |
# File 'lib/CFG/config.rb', line 168 def ==(other) @line == other.line && @column == other.column end |
#next_line ⇒ Object
154 155 156 157 |
# File 'lib/CFG/config.rb', line 154 def next_line self.line += 1 self.column = 1 end |
#to_s ⇒ Object
164 165 166 |
# File 'lib/CFG/config.rb', line 164 def to_s "(#{@line}, #{@column})" end |
#update(other) ⇒ Object
159 160 161 162 |
# File 'lib/CFG/config.rb', line 159 def update(other) @line = other.line @column = other.column end |