Class: ActiveSupport::Delegation::ClassDelegator

Inherits:
Delegator show all
Defined in:
activesupport/lib/active_support/delegation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Tryable

#try, #try!

Constructor Details

#initialize(delegated_obj) ⇒ ClassDelegator



27
28
29
# File 'activesupport/lib/active_support/delegation.rb', line 27

def initialize(delegated_obj)
  @delegate_dc_obj = delegated_obj
end

Instance Attribute Details

#delegate_dc_objObject (readonly) Also known as: __getobj__

Returns the value of attribute delegate_dc_obj.



23
24
25
# File 'activesupport/lib/active_support/delegation.rb', line 23

def delegate_dc_obj
  @delegate_dc_obj
end

Instance Method Details

#__setobj__(obj) ⇒ Object



31
32
33
34
# File 'activesupport/lib/active_support/delegation.rb', line 31

def __setobj__(obj)
  __raise__ ::ArgumentError, "cannot delegate to self" if equal?(obj)
  @delegate_dc_obj = obj
end