Sha256: bb1f62bfc698abdd84bb25c610fcef90117a11056c3907644cc31c05df63d014
Contents?: true
Size: 762 Bytes
Versions: 8
Compression:
Stored size: 762 Bytes
Contents
module Unit module Types class Address attr_reader :street, :city, :state, :postal_code, :country def initialize(street:, city:, state:, postal_code:, country:) @street = street @city = city @state = state @postal_code = postal_code @country = country end def self.cast(val) return val if val.is_a? self return nil if val.nil? new( street: val[:street], city: val[:city], state: val[:state], postal_code: val[:postal_code], country: val[:country] ) end def as_json_api { street: street, city: city, state: state, postal_code: postal_code, country: country } end end end end
Version data entries
8 entries across 8 versions & 1 rubygems