Class: Mws::Apis::Feeds::SalePrice

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(price, from, to) ⇒ SalePrice

Returns a new instance of SalePrice.



9
10
11
12
13
# File 'lib/mws/apis/feeds/sale_price.rb', line 9

def initialize(price, from, to)
  @price = price
  @from = from
  @to = to
end

Instance Attribute Details

#fromObject (readonly)

Returns the value of attribute from.



7
8
9
# File 'lib/mws/apis/feeds/sale_price.rb', line 7

def from
  @from
end

#priceObject (readonly)

Returns the value of attribute price.



7
8
9
# File 'lib/mws/apis/feeds/sale_price.rb', line 7

def price
  @price
end

#toObject (readonly)

Returns the value of attribute to.



7
8
9
# File 'lib/mws/apis/feeds/sale_price.rb', line 7

def to
  @to
end

Instance Method Details

#==(other) ⇒ Object



15
16
17
18
19
# File 'lib/mws/apis/feeds/sale_price.rb', line 15

def ==(other)
  return true if equal? other
  return false unless other.class == self.class
  @price == other.price and @from == other.from and @to == other.to
end

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



21
22
23
24
25
26
27
# File 'lib/mws/apis/feeds/sale_price.rb', line 21

def to_xml(name='Sale', parent=nil)
  Mws::Serializer.tree name, parent do |xml|
    xml.StartDate @from.iso8601
    xml.EndDate @to.iso8601
    price.to_xml 'SalePrice', xml
  end
end