Module: Platanus::Layered
- Defined in:
- lib/platanus/layered.rb
Overview
Adds simple proxy capabilities to a class, allowing it instances to wrap other objects transparently
Instance Attribute Summary collapse
-
#lo_target ⇒ Object
readonly
Returns the value of attribute lo_target.
Instance Method Summary collapse
- #initialize(_entity) ⇒ Object
- #method_missing(_method, *_args, &_block) ⇒ Object
- #respond_to?(_what) ⇒ Boolean
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(_method, *_args, &_block) ⇒ Object
17 18 19 |
# File 'lib/platanus/layered.rb', line 17 def method_missing(_method, *_args, &_block) @lo_target.send(_method, *_args, &_block) end |
Instance Attribute Details
#lo_target ⇒ Object (readonly)
Returns the value of attribute lo_target.
6 7 8 |
# File 'lib/platanus/layered.rb', line 6 def lo_target @lo_target end |
Instance Method Details
#initialize(_entity) ⇒ Object
8 9 10 |
# File 'lib/platanus/layered.rb', line 8 def initialize(_entity) @lo_target = _entity end |
#respond_to?(_what) ⇒ Boolean
12 13 14 15 |
# File 'lib/platanus/layered.rb', line 12 def respond_to?(_what) return true if super(_what) return @lo_target.respond_to? _what end |