class ArtGun::Order

Public Instance Methods

as_json(opts = {}) click to toggle source
Calls superclass method
# File lib/art_gun/order.rb, line 64
def as_json opts = {}
  hash = super opts
  hash['items'] = items.map(&:as_json)
  hash.inject({}) do |h, (k,v)|
    h[k] = v unless v.nil?
    h
  end
end
attributes() click to toggle source
# File lib/art_gun/order.rb, line 60
def attributes
  (self.class.attrs + %w(type time method mode status status_code)).inject({}){|h,k| h[k.to_s] = nil; h}
end
method() click to toggle source
# File lib/art_gun/order.rb, line 40
def method
  'create'
end
mode() click to toggle source
# File lib/art_gun/order.rb, line 44
def mode
  ArtGun.test_mode? ? 'debug' : 'auto'
end
shipping_phone() click to toggle source
# File lib/art_gun/order.rb, line 56
def shipping_phone
  @shipping_phone or '000-000-0000'
end
status() click to toggle source
# File lib/art_gun/order.rb, line 48
def status
  'In Production'
end
status_code() click to toggle source
# File lib/art_gun/order.rb, line 52
def status_code
  6
end
time() click to toggle source
# File lib/art_gun/order.rb, line 36
def time
  @time ||= Time.now.utc
end
type() click to toggle source
# File lib/art_gun/order.rb, line 32
def type
  'order'
end