Class: Farseer::Opt

Inherits:
Object
  • Object
show all
Includes:
MapFactory
Defined in:
lib/farseer/opt.rb

Instance Method Summary collapse

Methods included from MapFactory

#map

Constructor Details

#initialize(parser) ⇒ Opt

Returns a new instance of Opt.



7
8
9
10
# File 'lib/farseer/opt.rb', line 7

def initialize(parser)
  @parser = parser
  freeze
end

Instance Method Details

#parse(input) ⇒ Object



12
13
14
15
16
# File 'lib/farseer/opt.rb', line 12

def parse(input)
  @parser
    .parse(input)
    .map_none { Result.new('', input) }
end