Class: GoogleCheckout::Shipping::Pickup

Inherits:
Method
  • Object
show all
Defined in:
lib/google-checkout/shipping/pickup.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, price = '0.00', currency = 'USD') ⇒ Pickup

Returns a new instance of Pickup.



7
8
9
10
11
# File 'lib/google-checkout/shipping/pickup.rb', line 7

def initialize(name, price = '0.00', currency = 'USD')
  @name = name
  @price = price
  @currency = currency
end

Instance Attribute Details

#currencyObject

Returns the value of attribute currency.



5
6
7
# File 'lib/google-checkout/shipping/pickup.rb', line 5

def currency
  @currency
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/google-checkout/shipping/pickup.rb', line 5

def name
  @name
end

#priceObject

Returns the value of attribute price.



5
6
7
# File 'lib/google-checkout/shipping/pickup.rb', line 5

def price
  @price
end

Instance Method Details

#to_xmlObject



13
14
15
16
17
18
# File 'lib/google-checkout/shipping/pickup.rb', line 13

def to_xml
  xml = Builder::XmlMarkup.new
  xml.tag!('pickup', :name => name) do
    xml.tag!('price', price, :currency => currency)
  end
end