Class: Tequila::Node::Method

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#labelObject

Returns the value of attribute label.



146
147
148
# File 'lib/tree.rb', line 146

def label
  @label
end

#nameObject (readonly)

Returns the value of attribute name.



148
149
150
# File 'lib/tree.rb', line 148

def name
  @name
end

#paramsObject

Returns the value of attribute params.



147
148
149
# File 'lib/tree.rb', line 147

def params
  @params
end

Instance Method Details

#to_sObject



156
157
158
159
160
# File 'lib/tree.rb', line 156

def to_s
  name +
  (params.empty? ? '' : "(#{params * ','})") +
  (name == label ? '' : " => #{label}")
end