Class: String
Direct Known Subclasses
Spider::DataTypes::Binary, Spider::DataTypes::Password, Spider::DataTypes::Text, Spider::DataTypes::UUID
Instance Method Summary collapse
Instance Method Details
#to_bool ⇒ Object
2 3 4 5 6 |
# File 'lib/spiderfw/utils/mixins.rb', line 2 def to_bool return true if self == true || self =~ (/(true|Vero|t|yes|si|y|1)$/i) return false if self == false || self.blank? || self =~ (/(false|Falso|f|no|n|0)$/i) raise ArgumentError.new("invalid value for Boolean: \"#{self}\"") end |