Class: Mws::Apis::Feeds::Shipping::Override

Inherits:
Object
  • Object
show all
Defined in:
lib/mws/apis/feeds/shipping.rb

Constant Summary collapse

Type =
Mws::Enum.for(
  adjust: 'Additive', 
  replace: 'Exclusive'
)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(option, type, amount) ⇒ Override

Returns a new instance of Override.



107
108
109
110
111
# File 'lib/mws/apis/feeds/shipping.rb', line 107

def initialize(option, type, amount)
  @option = option
  @type = Type.for(type)
  @amount = amount
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



103
104
105
# File 'lib/mws/apis/feeds/shipping.rb', line 103

def amount
  @amount
end

#optionObject (readonly)

Returns the value of attribute option.



103
104
105
# File 'lib/mws/apis/feeds/shipping.rb', line 103

def option
  @option
end

Instance Method Details

#to_xml(name = 'ShippingOverride', parent = nil) ⇒ Object



113
114
115
116
117
118
119
# File 'lib/mws/apis/feeds/shipping.rb', line 113

def to_xml(name='ShippingOverride', parent=nil)
  Mws::Serializer.tree name, parent do |xml|
    xml.ShipOption @option
    xml.Type @type.val
    @amount.to_xml 'ShipAmount', xml
  end
end