Class: ScopedStruct::ProxyObject

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

Instance Method Summary collapse

Constructor Details

#initialize(parent, scope_name) ⇒ ProxyObject

Returns a new instance of ProxyObject.



14
15
16
# File 'lib/scoped_struct.rb', line 14

def initialize(parent, scope_name)
  @parent, @scope_name = parent, scope_name
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



18
19
20
# File 'lib/scoped_struct.rb', line 18

def method_missing(name, *args, &block)
  @parent.send(@scope_name.to_s + "_" + name.to_s, *args, &block)
end