Class: LabelMe::SalesAll::Row

Inherits:
Object
  • Object
show all
Defined in:
lib/label_me/sales_all/row.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(row) ⇒ Row

Returns a new instance of Row.



15
16
17
# File 'lib/label_me/sales_all/row.rb', line 15

def initialize(row)
  @row = row
end

Class Method Details

.parse(csv_path) ⇒ Object



8
9
10
11
12
# File 'lib/label_me/sales_all/row.rb', line 8

def parse(csv_path)
  open(csv_path, "r:windows-31j:utf-8") do |file|
    return CSV.new(file, headers: true).map{|row| LabelMe::SalesAll::Row.new(row) }
  end
end

Instance Method Details

#customer_addressObject



47
48
49
# File 'lib/label_me/sales_all/row.rb', line 47

def customer_address
  @row["購入者 都道府県"].to_s + @row["購入者 住所"].to_s
end

#customer_emailObject



51
52
53
# File 'lib/label_me/sales_all/row.rb', line 51

def customer_email
  @row["購入者 メールアドレス"].to_s
end

#customer_idObject

Accessors for customer column



35
36
37
# File 'lib/label_me/sales_all/row.rb', line 35

def customer_id
  @row["購入者 顧客ID"].to_s
end

#customer_nameObject



39
40
41
# File 'lib/label_me/sales_all/row.rb', line 39

def customer_name
  @row["購入者 名前"].to_s
end

#customer_phone_numberObject



55
56
57
# File 'lib/label_me/sales_all/row.rb', line 55

def customer_phone_number
  @row["購入者 電話番号"].to_s
end

#customer_postal_codeObject



43
44
45
# File 'lib/label_me/sales_all/row.rb', line 43

def customer_postal_code
  @row["購入者 郵便番号"].to_s
end

#line_item_codeObject



131
132
133
# File 'lib/label_me/sales_all/row.rb', line 131

def line_item_code
  @row["購入商品 商品ID"].to_s
end

#line_item_idObject

Accessors for line item column



127
128
129
# File 'lib/label_me/sales_all/row.rb', line 127

def line_item_id
  @row["売上詳細ID"].to_s
end

#line_item_quantityObject



139
140
141
# File 'lib/label_me/sales_all/row.rb', line 139

def line_item_quantity
  @row["購入商品 販売個数"].to_i
end

#line_item_unit_priceObject



135
136
137
# File 'lib/label_me/sales_all/row.rb', line 135

def line_item_unit_price
  @row["購入商品 販売価格(消費税込)"].to_i
end

#order_dateObject



27
28
29
# File 'lib/label_me/sales_all/row.rb', line 27

def order_date
  Date.parse(@row["受注日"])
end

#order_idObject

Accessors for general column



23
24
25
# File 'lib/label_me/sales_all/row.rb', line 23

def order_id
  @row["売上ID"].to_s
end

#paid?Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/label_me/sales_all/row.rb', line 67

def paid?
  /入金済/ === @row["入金状態"]
end

#recipient_addressObject



91
92
93
# File 'lib/label_me/sales_all/row.rb', line 91

def recipient_address
  @row["配送先 都道府県名"].to_s + @row["配送先 住所"].to_s
end

#recipient_idObject

Accessors for recipient column



75
76
77
# File 'lib/label_me/sales_all/row.rb', line 75

def recipient_id
  @row["配送先ID"].to_s
end

#recipient_kanaObject



83
84
85
# File 'lib/label_me/sales_all/row.rb', line 83

def recipient_kana
  @row["配送先 フリガナ"].to_s
end

#recipient_labelingObject



107
108
109
# File 'lib/label_me/sales_all/row.rb', line 107

def recipient_labeling
  @row["配送先 熨斗(のし)"].to_s
end

#recipient_message_card_bodyObject



115
116
117
# File 'lib/label_me/sales_all/row.rb', line 115

def recipient_message_card_body
  @row["配送先 メッセージカード内容"].to_s
end

#recipient_message_card_typeObject



111
112
113
# File 'lib/label_me/sales_all/row.rb', line 111

def recipient_message_card_type
  @row["配送先 メッセージカード種類"].to_s
end

#recipient_nameObject



79
80
81
# File 'lib/label_me/sales_all/row.rb', line 79

def recipient_name
  @row["配送先 名前"].to_s
end

#recipient_notesObject



119
120
121
# File 'lib/label_me/sales_all/row.rb', line 119

def recipient_notes
  @row["配送先 備考"].to_s
end

#recipient_phone_numberObject



95
96
97
# File 'lib/label_me/sales_all/row.rb', line 95

def recipient_phone_number
  @row["配送先 電話番号"].to_s
end

#recipient_postal_codeObject



87
88
89
# File 'lib/label_me/sales_all/row.rb', line 87

def recipient_postal_code
  @row["配送先 郵便番号"].to_s
end

#total_message_card_chargeObject



63
64
65
# File 'lib/label_me/sales_all/row.rb', line 63

def total_message_card_charge
  @row["メッセージカード手数料合計"].to_i
end

#total_shipping_chargeObject



59
60
61
# File 'lib/label_me/sales_all/row.rb', line 59

def total_shipping_charge
  @row["送料合計"].to_i
end

#wished_delivery_dateObject



99
100
101
# File 'lib/label_me/sales_all/row.rb', line 99

def wished_delivery_date
  @row["配送希望日"].to_s
end

#wished_delivery_timezoneObject



103
104
105
# File 'lib/label_me/sales_all/row.rb', line 103

def wished_delivery_timezone
  @row["配送希望時間"].to_s
end