Module: CardValidator::ParamParser

Defined in:
lib/card_validator/param_parser.rb

Class Method Summary collapse

Class Method Details

.parse_paramsObject


7
8
9
10
11
12
13
14
15
# File 'lib/card_validator/param_parser.rb', line 7

def parse_params
  params = {}
  OptionParser.new do |parser|
    parser.on("-c", "--card CARD", "Card number to validate.") do |v|
      params[:card] = v
    end
  end.parse!
  params[:card]
end