Class: Tequila::Node::CodeBlock
- Inherits:
-
Object
- Object
- Tequila::Node::CodeBlock
- Defined in:
- lib/tree.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
Instance Method Summary collapse
-
#initialize(label, code) ⇒ CodeBlock
constructor
A new instance of CodeBlock.
- #to_s ⇒ Object
Constructor Details
#initialize(label, code) ⇒ CodeBlock
Returns a new instance of CodeBlock.
135 136 137 138 |
# File 'lib/tree.rb', line 135 def initialize(label, code) @label = label @code = code end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
133 134 135 |
# File 'lib/tree.rb', line 133 def code @code end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
132 133 134 |
# File 'lib/tree.rb', line 132 def label @label end |
Instance Method Details
#to_s ⇒ Object
140 141 142 |
# File 'lib/tree.rb', line 140 def to_s label + code + "\n" end |