Class: PagSeguro::Item

Inherits:
Object
  • Object
show all
Includes:
Extensions::MassAssignment
Defined in:
lib/pagseguro/item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Extensions::MassAssignment

#initialize

Instance Attribute Details

#amountObject

Set the amount per unit.



16
17
18
# File 'lib/pagseguro/item.rb', line 16

def amount
  @amount
end

#descriptionObject

Set the product description.



9
10
11
# File 'lib/pagseguro/item.rb', line 9

def description
  @description
end

#idObject

Set the product identifier, such as SKU.



6
7
8
# File 'lib/pagseguro/item.rb', line 6

def id
  @id
end

#quantityObject

Set the quantity. Defaults to 1.



13
14
15
# File 'lib/pagseguro/item.rb', line 13

def quantity
  @quantity
end

#shipping_costObject

Set the shipping cost per unit.



22
23
24
# File 'lib/pagseguro/item.rb', line 22

def shipping_cost
  @shipping_cost
end

#weightObject

Set the weight per unit, in grams.



19
20
21
# File 'lib/pagseguro/item.rb', line 19

def weight
  @weight
end

Instance Method Details

#==(other) ⇒ Object



24
25
26
# File 'lib/pagseguro/item.rb', line 24

def ==(other)
  [id, description, amount] == [other.id, other.description, other.amount]
end