Class: GoogleCheckout::Shipping::MerchantCalculated
- Includes:
- Filters, Restrictions
- Defined in:
- lib/google-checkout/shipping/merchant_calculated.rb
Instance Attribute Summary collapse
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#name ⇒ Object
Returns the value of attribute name.
-
#price ⇒ Object
Returns the value of attribute price.
Attributes included from Filters
Attributes included from Restrictions
Instance Method Summary collapse
-
#initialize(name, price, currency = 'USD') ⇒ MerchantCalculated
constructor
A new instance of MerchantCalculated.
- #to_xml ⇒ Object
Methods included from Filters
#address_filters?, #address_filters_xml
Methods included from Restrictions
#shipping_restrictions?, #shipping_restrictions_xml
Constructor Details
#initialize(name, price, currency = 'USD') ⇒ MerchantCalculated
Returns a new instance of MerchantCalculated.
10 11 12 13 14 15 16 |
# File 'lib/google-checkout/shipping/merchant_calculated.rb', line 10 def initialize(name, price, currency = 'USD') @name = name @price = price @currency = currency @shipping_restrictions = {:allowed => [], :excluded => [], :allow_us_po_box => true} @address_filters = {:allowed => [], :excluded => [], :allow_us_po_box => true} end |
Instance Attribute Details
#currency ⇒ Object
Returns the value of attribute currency.
8 9 10 |
# File 'lib/google-checkout/shipping/merchant_calculated.rb', line 8 def currency @currency end |
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/google-checkout/shipping/merchant_calculated.rb', line 8 def name @name end |
#price ⇒ Object
Returns the value of attribute price.
8 9 10 |
# File 'lib/google-checkout/shipping/merchant_calculated.rb', line 8 def price @price end |
Instance Method Details
#to_xml ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/google-checkout/shipping/merchant_calculated.rb', line 18 def to_xml xml = Builder::XmlMarkup.new xml.tag!('merchant-calculated-shipping', :name => name) do xml.tag!('price', price, :currency => currency) xml << shipping_restrictions_xml if shipping_restrictions? xml << address_filters_xml if address_filters? end end |