Class: RubyPsigate::RecurringItem
- Inherits:
-
Object
- Object
- RubyPsigate::RecurringItem
- Includes:
- HashVariables
- Defined in:
- lib/ruby_psigate/recurring_item.rb
Instance Attribute Summary collapse
-
#cost ⇒ Object
Returns the value of attribute cost.
-
#description ⇒ Object
Returns the value of attribute description.
-
#price ⇒ Object
Returns the value of attribute price.
-
#product_id ⇒ Object
(also: #productid)
Returns the value of attribute product_id.
-
#quantity ⇒ Object
Returns the value of attribute quantity.
-
#tax1 ⇒ Object
Returns the value of attribute tax1.
-
#tax2 ⇒ Object
Returns the value of attribute tax2.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ RecurringItem
constructor
A new instance of RecurringItem.
- #to_hash ⇒ Object
Methods included from HashVariables
Constructor Details
#initialize(attributes = {}) ⇒ RecurringItem
Returns a new instance of RecurringItem.
10 11 12 13 14 15 16 17 |
# File 'lib/ruby_psigate/recurring_item.rb', line 10 def initialize(attributes = {}) @product_id = attributes[:product_id] @description = attributes[:description] @quantity = attributes[:quantity] @price = attributes[:price] @tax1 = attributes[:tax1] @tax2 = attributes[:tax2] end |
Instance Attribute Details
#cost ⇒ Object
Returns the value of attribute cost.
7 8 9 |
# File 'lib/ruby_psigate/recurring_item.rb', line 7 def cost @cost end |
#description ⇒ Object
Returns the value of attribute description.
7 8 9 |
# File 'lib/ruby_psigate/recurring_item.rb', line 7 def description @description end |
#price ⇒ Object
Returns the value of attribute price.
7 8 9 |
# File 'lib/ruby_psigate/recurring_item.rb', line 7 def price @price end |
#product_id ⇒ Object Also known as: productid
Returns the value of attribute product_id.
7 8 9 |
# File 'lib/ruby_psigate/recurring_item.rb', line 7 def product_id @product_id end |
#quantity ⇒ Object
Returns the value of attribute quantity.
7 8 9 |
# File 'lib/ruby_psigate/recurring_item.rb', line 7 def quantity @quantity end |
#tax1 ⇒ Object
Returns the value of attribute tax1.
7 8 9 |
# File 'lib/ruby_psigate/recurring_item.rb', line 7 def tax1 @tax1 end |
#tax2 ⇒ Object
Returns the value of attribute tax2.
7 8 9 |
# File 'lib/ruby_psigate/recurring_item.rb', line 7 def tax2 @tax2 end |
Instance Method Details
#to_hash ⇒ Object
19 20 21 22 23 |
# File 'lib/ruby_psigate/recurring_item.rb', line 19 def to_hash result = super result = result.delete_if { |key, value| value.nil? } # Delete empty hash values result end |