Module: Casting::MissingMethodClientClass

Defined in:
lib/casting/missing_method_client_class.rb

Defined Under Namespace

Modules: InstanceMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object



3
4
5
# File 'lib/casting/missing_method_client_class.rb', line 3

def self.extended(base)
  base.send(:include, InstanceMethods)
end

Instance Method Details

#__delegates__Object



44
45
46
47
# File 'lib/casting/missing_method_client_class.rb', line 44

def __delegates__
  Thread.current[:class_delegates] ||= {}
  Thread.current[:class_delegates][name] ||= []
end

#cast_as(attendant) ⇒ Object



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

def cast_as(attendant)
  __delegates__.unshift(attendant)
  self
end

#uncastObject



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

def uncast
  __delegates__.shift
  self
end