Class: Casting::Delegation

Inherits:
Object
  • Object
show all
Defined in:
lib/casting/delegation.rb

Instance Method Summary collapse

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

#clientObject



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