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.



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

def initialize(args)
  @args = args
end

Instance Attribute Details

#argsArray<String> (readonly)

Raw arguments

Returns:

  • (Array<String>)

    the current value of args



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

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:



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

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