Class: Rbjs::ArgumentProxy

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

Instance Method Summary collapse

Constructor Details

#initialize(root, name) ⇒ ArgumentProxy

Returns a new instance of ArgumentProxy.



139
140
141
142
# File 'lib/rbjs.rb', line 139

def initialize root, name
  @root = root
  @name = name
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



144
145
146
147
# File 'lib/rbjs.rb', line 144

def method_missing name, *args, &block
  expression = @root.send(@name)
  expression.send name, *args, &block
end

Instance Method Details

#to_sObject



149
150
151
# File 'lib/rbjs.rb', line 149

def to_s
  @name
end