Module: EcoRake::Options::Forwarding

Defined in:
lib/eco-rake/options/forwarding.rb,
lib/eco-rake/options/forwarding/rule.rb,
lib/eco-rake/options/forwarding/proxy.rb

Overview

Offers a way to relaunch command options from options results.

Defined Under Namespace

Modules: ClassMethods Classes: Proxy, Rule

Instance Method Summary collapse

Instance Method Details

#forward_option(sym, from: options) ⇒ Value

Returns the value defined by the rule linked to opt.

Parameters:

  • sym (Symbol)

    a short or name of an option that may be present in from

  • from (Hash) (defaults to: options)

    the parsed option results.

Returns:

  • (Value)

    the value defined by the rule linked to opt



34
35
36
# File 'lib/eco-rake/options/forwarding.rb', line 34

def forward_option(sym, from: options)
  self.class.options_proxy.forward(sym, from: from)
end

#forward_options(*syms, from: options) ⇒ Array<Value>

Returns the values defined by the rules linked to opts.

Returns:

  • (Array<Value>)

    the values defined by the rules linked to opts

See Also:

  • (the same but for multiple options)


40
41
42
# File 'lib/eco-rake/options/forwarding.rb', line 40

def forward_options(*syms, from: options)
  syms.map {|sym| forward_option(sym, from: from)}
end