Class: Tumugi::Parameter::BoolConverter

Inherits:
Object
  • Object
show all
Defined in:
lib/tumugi/parameter/converter.rb

Instance Method Summary collapse

Instance Method Details

#convert(value, opts = {}) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/tumugi/parameter/converter.rb', line 24

def convert(value, opts={})
  if value =~ /^(true|false)$/
    value == 'true'
  else
    raise ArgumentError.new("Invalid value for Bool: '#{value}'")
  end
end