Class: ChannelAdvisor::LineItem

Inherits:
Object
  • Object
show all
Defined in:
lib/channeladvisor/line_item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ LineItem

Returns a new instance of LineItem.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/channeladvisor/line_item.rb', line 8

def initialize(attrs={})
  @id                       = attrs[:line_item_id]
  @type                     = attrs[:line_item_type]
  @sku                      = attrs[:sku]
  @title                    = attrs[:title]
  @unit_price               = attrs[:unit_price].to_f
  @quantity                 = attrs[:quantity].to_i
  @allow_negative_quantity  = attrs[:allow_negative_quantity]
  @sale_source              = attrs[:item_sale_source]
  @buyer_user_id            = attrs[:buyer_user_id]
  @buyer_feedback_rating    = attrs[:buyer_feedback_rating]
  @sales_source_id          = attrs[:sales_source_id]
  @vat_rate                 = attrs[:vat_rate].to_f
  @tax_cost                 = attrs[:tax_cost].to_f
  @shipping_cost            = attrs[:shipping_cost].to_f
  @shipping_tax_cost        = attrs[:shipping_tax_cost].to_f
  @gift_wrap_cost           = attrs[:gift_wrap_cost].to_f
  @gift_wrap_tax_cost       = attrs[:gift_wrap_tax_cost].to_f
  @gift_message             = attrs[:gift_message]
  @gift_wrap_level          = attrs[:gift_wrap_level]
  @recycling_fee            = attrs[:recycling_fee].to_f
  @unit_weight              = attrs[:unit_weight].to_f
  @unit_of_measure          = attrs[:unit_of_measure]
  @warehouse_location       = attrs[:warehouse_location]
  @user_name                = attrs[:user_name]
  @distribution_center      = attrs[:distribution_center_code]
  @is_fba                   = attrs[:is_fba]
  @promo_code               = attrs[:promo_code]
end

Instance Attribute Details

#allow_negative_quantityObject

Returns the value of attribute allow_negative_quantity.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def allow_negative_quantity
  @allow_negative_quantity
end

#buyer_feedback_ratingObject

Returns the value of attribute buyer_feedback_rating.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def buyer_feedback_rating
  @buyer_feedback_rating
end

#buyer_user_idObject

Returns the value of attribute buyer_user_id.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def buyer_user_id
  @buyer_user_id
end

#distribution_centerObject

Returns the value of attribute distribution_center.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def distribution_center
  @distribution_center
end

#gift_messageObject

Returns the value of attribute gift_message.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def gift_message
  @gift_message
end

#gift_wrap_costObject

Returns the value of attribute gift_wrap_cost.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def gift_wrap_cost
  @gift_wrap_cost
end

#gift_wrap_levelObject

Returns the value of attribute gift_wrap_level.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def gift_wrap_level
  @gift_wrap_level
end

#gift_wrap_tax_costObject

Returns the value of attribute gift_wrap_tax_cost.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def gift_wrap_tax_cost
  @gift_wrap_tax_cost
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def id
  @id
end

#is_fbaObject

Returns the value of attribute is_fba.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def is_fba
  @is_fba
end

#promo_codeObject

Returns the value of attribute promo_code.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def promo_code
  @promo_code
end

#quantityObject

Returns the value of attribute quantity.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def quantity
  @quantity
end

#recycling_feeObject

Returns the value of attribute recycling_fee.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def recycling_fee
  @recycling_fee
end

#sale_sourceObject

Returns the value of attribute sale_source.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def sale_source
  @sale_source
end

#sales_source_idObject

Returns the value of attribute sales_source_id.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def sales_source_id
  @sales_source_id
end

#shipping_costObject

Returns the value of attribute shipping_cost.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def shipping_cost
  @shipping_cost
end

#shipping_tax_costObject

Returns the value of attribute shipping_tax_cost.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def shipping_tax_cost
  @shipping_tax_cost
end

#skuObject

Returns the value of attribute sku.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def sku
  @sku
end

#tax_costObject

Returns the value of attribute tax_cost.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def tax_cost
  @tax_cost
end

#titleObject

Returns the value of attribute title.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def title
  @title
end

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def type
  @type
end

#unit_of_measureObject

Returns the value of attribute unit_of_measure.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def unit_of_measure
  @unit_of_measure
end

#unit_priceObject

Returns the value of attribute unit_price.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def unit_price
  @unit_price
end

#unit_weightObject

Returns the value of attribute unit_weight.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def unit_weight
  @unit_weight
end

#user_nameObject

Returns the value of attribute user_name.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def user_name
  @user_name
end

#vat_rateObject

Returns the value of attribute vat_rate.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def vat_rate
  @vat_rate
end

#warehouse_locationObject

Returns the value of attribute warehouse_location.



3
4
5
# File 'lib/channeladvisor/line_item.rb', line 3

def warehouse_location
  @warehouse_location
end