class String def decapitalize self[0, 1].downcase + self[1..-1] end def to_class Object.const_get(self) end def to_bool 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