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

Version Path
attune-1.0.21 lib/attune/models/customer.rb
attune-1.0.20 lib/attune/models/customer.rb
attune-1.0.19 lib/attune/models/customer.rb
attune-1.0.18 lib/attune/models/customer.rb
attune-1.0.17 lib/attune/models/customer.rb
attune-1.0.16 lib/attune/models/customer.rb
attune-1.0.15 lib/attune/models/customer.rb
attune-1.0.14 lib/attune/models/customer.rb
attune-1.0.13 lib/attune/models/customer.rb
attune-1.0.12 lib/attune/models/customer.rb
attune-1.0.11 lib/attune/models/customer.rb
attune-1.0.10 lib/attune/models/customer.rb
attune-1.0.9 lib/attune/models/customer.rb
attune-1.0.8 lib/attune/models/customer.rb
attune-1.0.7 lib/attune/models/customer.rb