Class: Grom::Node
- Inherits:
-
Object
- Object
- Grom::Node
- Defined in:
- lib/grom/node.rb
Instance Attribute Summary collapse
-
#statements ⇒ Object
readonly
Returns the value of attribute statements.
Instance Method Summary collapse
-
#initialize(statements) ⇒ Node
constructor
A new instance of Node.
- #method_missing(method, *params, &block) ⇒ Object
- #respond_to_missing?(method, include_private = false) ⇒ Boolean
Constructor Details
#initialize(statements) ⇒ Node
Returns a new instance of Node.
5 6 7 8 9 |
# File 'lib/grom/node.rb', line 5 def initialize(statements) @statements = statements populate end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *params, &block) ⇒ Object
11 12 13 |
# File 'lib/grom/node.rb', line 11 def method_missing(method, *params, &block) instance_variable_get("@#{method}".to_sym) || super end |
Instance Attribute Details
#statements ⇒ Object (readonly)
Returns the value of attribute statements.
3 4 5 |
# File 'lib/grom/node.rb', line 3 def statements @statements end |
Instance Method Details
#respond_to_missing?(method, include_private = false) ⇒ Boolean
15 16 17 |
# File 'lib/grom/node.rb', line 15 def respond_to_missing?(method, include_private = false) instance_variable_get("@#{method}".to_sym) || super end |