Module: Casting::Client

Defined in:
lib/casting.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



29
30
31
32
33
# File 'lib/casting.rb', line 29

def self.included(base)
  def base.delegate_missing_methods
    self.send(:include, ::Casting::MissingMethodClient)
  end
end

Instance Method Details

#delegate(delegated_method_name, attendant, *args) ⇒ Object



39
40
41
# File 'lib/casting.rb', line 39

def delegate(delegated_method_name, attendant, *args)
  delegation(delegated_method_name).to(attendant).with(*args).call
end

#delegate_missing_methodsObject



43
44
45
# File 'lib/casting.rb', line 43

def delegate_missing_methods
  self.extend ::Casting::MissingMethodClient
end

#delegation(delegated_method_name) ⇒ Object



35
36
37
# File 'lib/casting.rb', line 35

def delegation(delegated_method_name)
  Casting::Delegation.new(delegated_method_name, self)
end