Class: PagSeguro::Item
- Inherits:
-
Object
- Object
- PagSeguro::Item
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/pagseguro/item.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Set the amount per unit.
-
#description ⇒ Object
Set the product description.
-
#id ⇒ Object
Set the product identifier, such as SKU.
-
#quantity ⇒ Object
Set the quantity.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Item
constructor
A new instance of Item.
Constructor Details
#initialize(options = {}) ⇒ Item
Returns a new instance of Item.
22 23 24 25 26 27 |
# File 'lib/pagseguro/item.rb', line 22 def initialize( = {}) @id = [:id] @description = [:description] @amount = [:amount] @quantity = [:quantity] || 1 end |
Instance Attribute Details
#amount ⇒ Object
Set the amount per unit.
16 17 18 |
# File 'lib/pagseguro/item.rb', line 16 def amount @amount end |
#description ⇒ Object
Set the product description.
13 14 15 |
# File 'lib/pagseguro/item.rb', line 13 def description @description end |
#id ⇒ Object
Set the product identifier, such as SKU.
10 11 12 |
# File 'lib/pagseguro/item.rb', line 10 def id @id end |
#quantity ⇒ Object
Set the quantity. Defaults to 1.
20 21 22 |
# File 'lib/pagseguro/item.rb', line 20 def quantity @quantity end |