Class: DataKit::Converters::Boolean
- Inherits:
-
Object
- Object
- DataKit::Converters::Boolean
- Defined in:
- lib/data_kit/converters/boolean.rb
Class Method Summary collapse
Class Method Details
.convert(value) ⇒ Object
5 6 7 8 |
# File 'lib/data_kit/converters/boolean.rb', line 5 def convert(value) downcased = value.downcase downcased == 'true' || downcased == 't' end |
.match?(value) ⇒ Boolean
10 11 12 |
# File 'lib/data_kit/converters/boolean.rb', line 10 def match?(value) (value =~ /\A(true|t|false|f)\z/i) == 0 end |