Class: Top4R::Order

Inherits:
Object
  • Object
show all
Includes:
ModelMixin
Defined in:
lib/top4r/model/trade.rb

Overview

Order model

Constant Summary collapse

@@ATTRIBUTES =
[:id, :iid, :sku_id, :sku_properties_name, :item_meal_name, :num, :title, 
:price, :pic_path, :seller_nick, :buyer_nick, :type, :created, :refund_status, :tid, 
:outer_iid, :outer_sku_id, :total_fee, :payment, :discount_fee, :adjust_fee, :status, 
:snapshot_url, :timeout_action_time]

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ModelMixin

included

Class Method Details

.attributesObject



12
# File 'lib/top4r/model/trade.rb', line 12

def attributes; @@ATTRIBUTES; end

.default_public_fieldsObject



14
15
16
17
# File 'lib/top4r/model/trade.rb', line 14

def default_public_fields
  ["orders.title", "orders.price", "orders.num", "orders.iid", "orders.status", "orders.tid", 
    "orders.total_fee", "orders.payment", "orders.pic_path"]
end

Instance Method Details

#confirm_feesObject



20
21
22
# File 'lib/top4r/model/trade.rb', line 20

def confirm_fees
  @client.trade(@tid, :confirmfee, {:is_detail => "IS_CHILD"})
end

#unmarshal_other_attrsObject



24
25
26
27
# File 'lib/top4r/model/trade.rb', line 24

def unmarshal_other_attrs
  @id = 0
  self
end