Class: RubySimpleParser::CodeLine
- Inherits:
-
Object
- Object
- RubySimpleParser::CodeLine
- Defined in:
- lib/generators/brain_damage/lib/ruby_simple_parser/code_line.rb
Instance Attribute Summary collapse
-
#line ⇒ Object
Returns the value of attribute line.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
-
#initialize(line, parent = nil) ⇒ CodeLine
constructor
A new instance of CodeLine.
- #print ⇒ Object
Constructor Details
#initialize(line, parent = nil) ⇒ CodeLine
Returns a new instance of CodeLine.
6 7 8 9 10 |
# File 'lib/generators/brain_damage/lib/ruby_simple_parser/code_line.rb', line 6 def initialize(line, parent = nil) @parent = parent @line = line @parent.add_line self if @parent end |
Instance Attribute Details
#line ⇒ Object
Returns the value of attribute line.
3 4 5 |
# File 'lib/generators/brain_damage/lib/ruby_simple_parser/code_line.rb', line 3 def line @line end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
4 5 6 |
# File 'lib/generators/brain_damage/lib/ruby_simple_parser/code_line.rb', line 4 def parent @parent end |
Instance Method Details
#print ⇒ Object
12 13 14 |
# File 'lib/generators/brain_damage/lib/ruby_simple_parser/code_line.rb', line 12 def print @line end |