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

Inherits:
BasicObject
Defined in:
lib/origen_testers/atp.rb

Instance Method Summary collapse

Constructor Details

#initialize(&callable) ⇒ LazyObject

Returns a new instance of LazyObject.



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

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



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

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

Instance Method Details

#__target_object__Object



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

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