Class: LazyLoad::Mixin::Wrapper
- Inherits:
-
Object
- Object
- LazyLoad::Mixin::Wrapper
- Defined in:
- lib/lazy_load.rb
Instance Attribute Summary collapse
-
#wrapped ⇒ Object
readonly
Returns the value of attribute wrapped.
Instance Method Summary collapse
-
#initialize(wrapped) ⇒ Wrapper
constructor
A new instance of Wrapper.
- #method_missing(*args) ⇒ Object
- #respond_to?(name) ⇒ Boolean
Constructor Details
#initialize(wrapped) ⇒ Wrapper
Returns a new instance of Wrapper.
82 83 84 |
# File 'lib/lazy_load.rb', line 82 def initialize(wrapped) @wrapped = wrapped end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args) ⇒ Object
87 88 89 |
# File 'lib/lazy_load.rb', line 87 def method_missing(*args) @wrapped.send(*args) end |
Instance Attribute Details
#wrapped ⇒ Object (readonly)
Returns the value of attribute wrapped.
85 86 87 |
# File 'lib/lazy_load.rb', line 85 def wrapped @wrapped end |
Instance Method Details
#respond_to?(name) ⇒ Boolean
91 92 93 |
# File 'lib/lazy_load.rb', line 91 def respond_to?(name) super || @wrapped.respond_to?(name) end |