Class: Snuffle::Element::MethodDefinition
- Inherits:
-
Object
- Object
- Snuffle::Element::MethodDefinition
- Defined in:
- lib/snuffle/elements/method_definition.rb
Instance Attribute Summary collapse
-
#node ⇒ Object
Returns the value of attribute node.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(node) ⇒ MethodDefinition
constructor
A new instance of MethodDefinition.
- #method_name ⇒ Object
- #values ⇒ Object
Constructor Details
#initialize(node) ⇒ MethodDefinition
Returns a new instance of MethodDefinition.
9 10 11 |
# File 'lib/snuffle/elements/method_definition.rb', line 9 def initialize(node) self.node = node end |
Instance Attribute Details
#node ⇒ Object
Returns the value of attribute node.
3 4 5 |
# File 'lib/snuffle/elements/method_definition.rb', line 3 def node @node end |
Class Method Details
.materialize(nodes = []) ⇒ Object
5 6 7 |
# File 'lib/snuffle/elements/method_definition.rb', line 5 def self.materialize(nodes=[]) nodes.each.map{|node| new(node) } end |
Instance Method Details
#method_name ⇒ Object
13 14 15 |
# File 'lib/snuffle/elements/method_definition.rb', line 13 def method_name node.name end |
#values ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/snuffle/elements/method_definition.rb', line 17 def values begin return [] unless node && node.children.objects.any? node.children.objects[1].children.map{|child| child.name}.flatten rescue [] end end |