Sha256: f7d9d1dd0c4fd98c6d2cf49c0af007ed1c536c6b2d8bed531f04afffb128d625
Contents?: true
Size: 452 Bytes
Versions: 3
Compression:
Stored size: 452 Bytes
Contents
module Coercer class Boolean def self.coerce(arg, default = nil) if arg == true true else false end end end class Integer def self.coerce(arg, default = nil) if arg.nil? default else Integer(arg) end end end class String def self.coerce(arg, default = nil) if arg.nil? default else String(arg) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
attribrutal-0.0.6 | lib/attribrutal/coercion.rb |
attribrutal-0.0.5 | lib/attribrutal/coercion.rb |
attribrutal-0.0.4 | lib/attribrutal/coercion.rb |