Class: Mws::Apis::Feeds::SalePrice
- Inherits:
-
Object
- Object
- Mws::Apis::Feeds::SalePrice
- Defined in:
- lib/mws/apis/feeds/sale_price.rb
Instance Attribute Summary collapse
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#price ⇒ Object
readonly
Returns the value of attribute price.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(price, from, to) ⇒ SalePrice
constructor
A new instance of SalePrice.
- #to_xml(name = 'Sale', parent = nil) ⇒ Object
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
#from ⇒ Object (readonly)
Returns the value of attribute from.
7 8 9 |
# File 'lib/mws/apis/feeds/sale_price.rb', line 7 def from @from end |
#price ⇒ Object (readonly)
Returns the value of attribute price.
7 8 9 |
# File 'lib/mws/apis/feeds/sale_price.rb', line 7 def price @price end |
#to ⇒ Object (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 |