lib/bootstripe/string_additions.rb in bootstripe-0.2.17 vs lib/bootstripe/string_additions.rb in bootstripe-0.2.18
- old
+ new
@@ -6,10 +6,10 @@
def to_class
Object.const_get(self)
end
def to_bool
- return true if self == true || self =~ (/(true|t|yes|y|1)$/i)
- return false if self == false || self.empty? || self =~ (/(false|f|no|n|0)$/i)
+ return true if self == true || self =~ (/(true|t|yes|y|1|on)$/i)
+ return false if self == false || self.empty? || self =~ (/(false|f|no|n|0|off)$/i)
raise ArgumentError.new("invalid value for Boolean: \"#{self}\"")
end
end
\ No newline at end of file