Class: Google4R::Checkout::Item::Subscription::RecurrentItem

Inherits:
Google4R::Checkout::Item show all
Defined in:
lib/google4r/checkout/shared.rb

Instance Attribute Summary collapse

Attributes inherited from Google4R::Checkout::Item

#description, #digital_content, #id, #name, #private_data, #quantity, #shopping_cart, #tax_table, #unit_price, #weight

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Google4R::Checkout::Item

#create_digital_content, #create_subscription

Constructor Details

#initialize(subscription) ⇒ RecurrentItem

Returns a new instance of RecurrentItem.



538
539
540
# File 'lib/google4r/checkout/shared.rb', line 538

def initialize(subscription)
  @subscription = subscription
end

Instance Attribute Details

#subscriptionObject

Returns the value of attribute subscription.



536
537
538
# File 'lib/google4r/checkout/shared.rb', line 536

def subscription
  @subscription
end

Class Method Details

.create_from_element(element, subscription) ⇒ Object



542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
# File 'lib/google4r/checkout/shared.rb', line 542

def self.create_from_element(element, subscription)
  item = super(element, nil)
  
  result = RecurrentItem.new(subscription)
  result.description = item.description
  result.digital_content = item.digital_content
  result.id = item.id
  result.name = item.name
  result.private_data = item.private_data
  result.quantity = item.quantity
  result.tax_table = item.tax_table
  result.unit_price = item.unit_price
  result.weight = item.weight
  
  return result
end