Class: Casting::Delegation
- Inherits:
-
Object
- Object
- Casting::Delegation
- Defined in:
- lib/casting/delegation.rb
Instance Method Summary collapse
- #call(*args) ⇒ Object
- #client ⇒ Object
-
#initialize(delegated_method_name, client) ⇒ Delegation
constructor
A new instance of Delegation.
- #to(object_or_module) ⇒ Object
- #with(*args, &block) ⇒ Object
Constructor Details
#initialize(delegated_method_name, client) ⇒ Delegation
Returns a new instance of Delegation.
9 10 11 |
# File 'lib/casting/delegation.rb', line 9 def initialize(delegated_method_name, client) @prepared_delegation = PreparedDelegation.new(:delegated_method_name => delegated_method_name, :client => client) end |
Instance Method Details
#call(*args) ⇒ Object
27 28 29 |
# File 'lib/casting/delegation.rb', line 27 def call(*args) prepared_delegation.call(*args) end |
#client ⇒ Object
13 14 15 |
# File 'lib/casting/delegation.rb', line 13 def client prepared_delegation.client end |
#to(object_or_module) ⇒ Object
17 18 19 20 |
# File 'lib/casting/delegation.rb', line 17 def to(object_or_module) prepared_delegation.to(object_or_module) self end |
#with(*args, &block) ⇒ Object
22 23 24 25 |
# File 'lib/casting/delegation.rb', line 22 def with(*args, &block) prepared_delegation.with(*args, &block) self end |