Method: CommandMapper::Arg#validate
- Defined in:
- lib/command_mapper/arg.rb
#validate(value) ⇒ true, (false, String)
Validates whether a given value is compatible with the arg.
69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/command_mapper/arg.rb', line 69 def validate(value) if value.nil? if required? return [false, "does not accept a nil value"] else return true end else return @type.validate(value) end end |