Module: Forwarder

Defined in:
lib/forwarder/version.rb,
lib/forwarder.rb,
lib/forwarder/meta.rb,
lib/forwarder/params.rb,
lib/forwarder/evaller.rb,
lib/forwarder/compiler.rb,
lib/forwarder/arguments.rb

Overview

frozen_string_literals: true

Defined Under Namespace

Modules: Evaller Classes: Arguments, Compiler, Meta, Params

Constant Summary collapse

Version =
'0.1.0'

Instance Method Summary collapse

Instance Method Details

#forward(*args, &blk) ⇒ Object

How forward works: The parameters are analyzied by the Params object by means of the ‘prepare_forward` method. The `prepare_forward` method makes have use of the Argument object which implements a query API for what the given arguments allow the forwarder to do. And eventually the `forward!` method realises the delegation



13
14
15
16
17
# File 'lib/forwarder.rb', line 13

def forward *args, &blk
  params = Forwarder::Params.new self
  params.prepare_forward( *args, &blk )
  params.forward!
end

#forward_all(*args, &blk) ⇒ Object



19
20
21
22
23
24
# File 'lib/forwarder.rb', line 19

def forward_all *args, &blk
  opts   = args.pop
  args.each do | arg |
    forward(arg, opts, &blk)
  end
end