Class: PagseguroV2::Item
- Inherits:
-
Hashie::Dash
- Object
- Hashie::Dash
- PagseguroV2::Item
- Defined in:
- lib/pagseguro_v2/item.rb
Instance Method Summary collapse
Instance Method Details
#quantity ⇒ Object
22 23 24 |
# File 'lib/pagseguro_v2/item.rb', line 22 def quantity self[:quantity].to_i end |
#to_xml(options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/pagseguro_v2/item.rb', line 10 def to_xml( = {}) builder = [:builder] || Builder::XmlMarkup.new() builder.item do |item| item.id id item.description description item.amount amount item.quantity quantity item.shippingCost shipping_cost if shipping_cost item.weight weight if weight end end |
#weight ⇒ Object
26 27 28 |
# File 'lib/pagseguro_v2/item.rb', line 26 def weight self[:weight].to_i if self[:weight] end |