Sha256: 2ac073a71ae9302fe11b7c433ca1bb4ab2d790b270293a21dfb617f6a3ed86a3
Contents?: true
Size: 797 Bytes
Versions: 15
Compression:
Stored size: 797 Bytes
Contents
module Attune module Model # Customer associated with an anonymous user # # @attr [String] customer class Customer attr_accessor :customer def initialize(attributes = {}) return if attributes.empty? # Workaround since JSON.parse has accessors as strings rather than symbols @customer = attributes["customer"] || attributes[:"customer"] end def to_body Hash[ATTRIBUTE_MAP.map do |internal, external| next unless value = send(internal) [external, value] end.compact] end def to_json(options = {}) to_body.to_json end private # :internal => :external ATTRIBUTE_MAP = { :customer => :customer } end end end
Version data entries
15 entries across 15 versions & 1 rubygems