Sha256: d7dff83611202c35fea5845bfa8ff407099e4fba9d6a3230041d33b43ddc93a3
Contents?: true
Size: 388 Bytes
Versions: 15
Compression:
Stored size: 388 Bytes
Contents
module ActiveRemote module Typecasting class BooleanTypecaster FALSE_VALUES = ["n", "N", "no", "No", "NO", "false", "False", "FALSE", "off", "Off", "OFF", "f", "F"] def self.call(value) case value when *FALSE_VALUES then false when Numeric, /^\-?[0-9]/ then !value.to_f.zero? else value.present? end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems