Module: Bake::Types::Boolean
- Extended by:
- Type
- Defined in:
- lib/bake/types/boolean.rb
Class Method Summary collapse
Methods included from Type
Class Method Details
.composite? ⇒ Boolean
13 14 15 |
# File 'lib/bake/types/boolean.rb', line 13 def self.composite? false end |
.parse(input) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/bake/types/boolean.rb', line 17 def self.parse(input) if input =~ /t(rue)?|y(es)?/i return true elsif input =~ /f(alse)?|n(o)?/i return false else raise ArgumentError, "Cannot coerce #{input.inspect} into boolean!" end end |