Sha256: 22eb0bb78044e251afed01b81af2cba9ba67358c6b89b79b09de142e895626d9
Contents?: true
Size: 397 Bytes
Versions: 13
Compression:
Stored size: 397 Bytes
Contents
module Superstore module AttributeMethods class Definition attr_reader :name, :type def initialize(model, name, type_class, options) @name = name.to_s @type = type_class.new(model, options) end def instantiate(value) return if value.nil? value.kind_of?(String) ? type.decode(value) : type.typecast(value) end end end end
Version data entries
13 entries across 13 versions & 1 rubygems