Sha256: 851e63d1778202a540a5a9f3e15d5a20e55d0b5f761de2ad85fe4da0f8875262
Contents?: true
Size: 417 Bytes
Versions: 10
Compression:
Stored size: 417 Bytes
Contents
module Converter # convert the value to an integer if we have numbers only # otherwise we return the string def convert_to_i(val) val = val.to_i if val =~ /^\d+$/ val end def self.to_boolean(value) if ["true", "True", "TRUE", true, "yes", "y", "YES", "Y"].include? value true elsif ["false", "False", "FALSE", false, "no", "n", "NO", "N"].include? value false end end end
Version data entries
10 entries across 10 versions & 1 rubygems