Module: Lab42::Forwarder3

Extended by:
Forwardable
Defined in:
lib/lab42/forwarder3.rb,
lib/lab42/forwarder3/version.rb,
lib/lab42/forwarder3/implementation.rb

Defined Under Namespace

Modules: Implementation

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(by) ⇒ Object



5
6
7
# File 'lib/lab42/forwarder3.rb', line 5

def self.extended by
  by.extend Forwardable
end

Instance Method Details

#forward(mthd_name, to:, as: nil) ⇒ Object



10
11
12
13
# File 'lib/lab42/forwarder3.rb', line 10

def forward(mthd_name, to:, as: nil)
  as ||= mthd_name
  Implementation.define_forwarder(mthd_name, to: to, as: as, receiver: self)
end

#forward_all(*mthd_names, to:) ⇒ Object



15
16
17
18
19
# File 'lib/lab42/forwarder3.rb', line 15

def forward_all(*mthd_names, to:)
  mthd_names.each do |mthd_name|
    forward mthd_name, to: to
  end
end