Module: Eco::Language::Delegation::DelegatingMissingConst

Included in:
API::UseCases::Service::Sftp
Defined in:
lib/eco/language/delegation/delegating_missing_const.rb

Overview

Note:

it uses DelegatingMissing.

Note:

it tries to lookup on the class of the delegating_missing_to object. Which requires an instance of the delegator to exist, with the aim of scoping its class (so it can chain constant lookup), unless delegated_class is explicitly stated.

Note:

that not setting delegated_class explicitly could fail to chain the lookup.

Class to lookup constants through delegated_class.

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/eco/language/delegation/delegating_missing_const.rb', line 12

def included(base)
  super

  base.send :include, DelegatingMissing
  base.send :include, ForDelegator::ConstDelegator
  base.extend ClassMethods

  # because we inject `#initialize`
  base.send :prepend, InstanceMethods
end