Class: Tequila::Node::CodeBlock

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#codeObject (readonly)

Returns the value of attribute code.



133
134
135
# File 'lib/tree.rb', line 133

def code
  @code
end

#labelObject (readonly)

Returns the value of attribute label.



132
133
134
# File 'lib/tree.rb', line 132

def label
  @label
end

Instance Method Details

#to_sObject



140
141
142
# File 'lib/tree.rb', line 140

def to_s
  label + code + "\n"
end