Module: Eco::Language::Delegation::DelegatingMissingConst::InstanceMethods
- Defined in:
- lib/eco/language/delegation/delegating_missing_const.rb
Instance Method Summary collapse
-
#initialize ⇒ Object
Set the
delegated_classto chain constant lookup viadelegating_missing_to.class.
Instance Method Details
#initialize ⇒ Object
Note:
this requires that the target can be fetched without passing
parameters (as it is typically the case with delegating_missing_to).
Set the delegated_class to chain constant lookup
via delegating_missing_to.class.
42 43 44 45 46 47 48 49 50 |
# File 'lib/eco/language/delegation/delegating_missing_const.rb', line 42 def initialize(...) super if defined?(super) delegated_class.tap do next unless (target = self.class.delegating_missing_target(self)) self.class.delegated_class target.class end end |