Class: Consoler::Arguments

Inherits:
Object
  • Object
show all
Defined in:
lib/consoler/arguments.rb

Overview

Arguments

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Arguments

Returns a new instance of Arguments.



12
13
14
# File 'lib/consoler/arguments.rb', line 12

def initialize(args)
  @args = args
end

Instance Attribute Details

#argsArray<String> (readonly)

Raw arguments

Returns:

  • (Array<String>)

    the current value of args



9
10
11
# File 'lib/consoler/arguments.rb', line 9

def args
  @args
end

Instance Method Details

#match(options) ⇒ Hash?

Match arguments against options

Returns:

  • (Hash, nil)

    Matched information, or nil is returned when there was no match

See Also:



20
21
22
23
# File 'lib/consoler/arguments.rb', line 20

def match(options)
  matcher = Consoler::Matcher.new self, options
  matcher.match
end