Class: CryptReboot::Cli::Params::Parser
- Inherits:
-
Object
- Object
- CryptReboot::Cli::Params::Parser
- Defined in:
- lib/crypt_reboot/cli/params/parser.rb
Overview
Parse given ARGV and return params hash or raise exception with error summary
Constant Summary collapse
- ParseError =
Class.new StandardError
Instance Method Summary collapse
Instance Method Details
#call(raw_params) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/crypt_reboot/cli/params/parser.rb', line 10 def call(raw_params) params = definition.parse(raw_params).params raise ParseError, params.errors.summary unless params.valid? flattener.call params.to_h end |