Class: ActiveSupport::Delegation::ClassDelegator
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
::Delegator
|
|
|
Instance Chain:
|
|
| Inherits: | Delegator |
| Defined in: | activesupport/lib/active_support/delegation.rb |
Class Method Summary
- .new(delegated_obj) ⇒ ClassDelegator constructor
Instance Attribute Summary
-
#__getobj__
readonly
Alias for #delegate_dc_obj.
- #delegate_dc_obj (also: #__getobj__) readonly
Instance Method Summary
::Delegator - Inherited
| #try | See Object#try |
| #try! | See Object#try! |
::ActiveSupport::Tryable - Included
Constructor Details
.new(delegated_obj) ⇒ ClassDelegator
# File 'activesupport/lib/active_support/delegation.rb', line 27
def initialize(delegated_obj) @delegate_dc_obj = delegated_obj end
Instance Attribute Details
#__getobj__ (readonly)
Alias for #delegate_dc_obj.
# File 'activesupport/lib/active_support/delegation.rb', line 24
alias_method :__getobj__, :delegate_dc_obj
#delegate_dc_obj (readonly) Also known as: #__getobj__
[ GitHub ]# File 'activesupport/lib/active_support/delegation.rb', line 23
attr_reader :delegate_dc_obj
Instance Method Details
#__setobj__(obj)
[ GitHub ]# 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