Class: PatternMatching::Node
- Inherits:
-
Object
- Object
- PatternMatching::Node
- Defined in:
- lib/patternmatching/pattern.rb
Overview
Class for structured data/patterns
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #[](index) ⇒ Object
-
#initialize(name, children) ⇒ Node
constructor
A new instance of Node.
- #size ⇒ Object
Constructor Details
#initialize(name, children) ⇒ Node
Returns a new instance of Node.
101 102 103 104 |
# File 'lib/patternmatching/pattern.rb', line 101 def initialize(name, children) @name = name @children = children end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
105 106 107 |
# File 'lib/patternmatching/pattern.rb', line 105 def name @name end |
Instance Method Details
#[](index) ⇒ Object
106 107 108 |
# File 'lib/patternmatching/pattern.rb', line 106 def [](index) @children[index] end |
#size ⇒ Object
109 110 111 |
# File 'lib/patternmatching/pattern.rb', line 109 def size @children.size end |