Class: Tequila::Node::Method
- Inherits:
-
Object
- Object
- Tequila::Node::Method
- Defined in:
- lib/tree.rb
Instance Attribute Summary collapse
-
#label ⇒ Object
Returns the value of attribute label.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#params ⇒ Object
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(name) ⇒ Method
constructor
A new instance of Method.
- #to_s ⇒ Object
Constructor Details
#initialize(name) ⇒ Method
Returns a new instance of Method.
150 151 152 153 154 |
# File 'lib/tree.rb', line 150 def initialize(name) @name = name @label = name @params = [] end |
Instance Attribute Details
#label ⇒ Object
Returns the value of attribute label.
146 147 148 |
# File 'lib/tree.rb', line 146 def label @label end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
148 149 150 |
# File 'lib/tree.rb', line 148 def name @name end |
#params ⇒ Object
Returns the value of attribute params.
147 148 149 |
# File 'lib/tree.rb', line 147 def params @params end |
Instance Method Details
#to_s ⇒ Object
156 157 158 159 160 |
# File 'lib/tree.rb', line 156 def to_s name + (params.empty? ? '' : "(#{params * ','})") + (name == label ? '' : " => #{label}") end |