Class: Grom::Node

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#statementsObject (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

Returns:

  • (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