Class: ATP::AST::Builder::LazyObject

Inherits:
BasicObject
Defined in:
lib/atp.rb

Instance Method Summary collapse

Constructor Details

#initialize(&callable) ⇒ LazyObject

Returns a new instance of LazyObject.



21
22
23
# File 'lib/atp.rb', line 21

def initialize(&callable)
  @callable = callable
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



29
30
31
# File 'lib/atp.rb', line 29

def method_missing(method_name, *args, &block)
  __target_object__.send(method_name, *args, &block)
end

Instance Method Details

#__target_object__Object



25
26
27
# File 'lib/atp.rb', line 25

def __target_object__
  @__target_object__ ||= @callable.call
end