Class: ActiveSupport::Delegation::ClassDelegator
- Defined in:
- activesupport/lib/active_support/delegation.rb
Instance Attribute Summary collapse
-
#delegate_dc_obj ⇒ Object
(also: #__getobj__)
readonly
Returns the value of attribute delegate_dc_obj.
Instance Method Summary collapse
- #__setobj__(obj) ⇒ Object
-
#initialize(delegated_obj) ⇒ ClassDelegator
constructor
A new instance of ClassDelegator.
Methods included from Tryable
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_obj ⇒ Object (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 |