Class: PagSeguro::Item

Inherits:
Object
  • Object
show all
Extended by:
ConvertFieldToDigit
Includes:
ActiveModel::Validations
Defined in:
lib/pag_seguro/item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ConvertFieldToDigit

attr_reader_as_digit

Constructor Details

#initialize(attributes = {}) ⇒ Item

Returns a new instance of Item.



16
17
18
19
20
21
22
23
# File 'lib/pag_seguro/item.rb', line 16

def initialize(attributes = {})
  @id = attributes[:id]
  @description = attributes[:description]
  @amount = attributes[:amount]
  @quantity = attributes[:quantity]
  @shipping_cost = attributes[:shipping_cost]
  @weight = attributes[:weight]
end

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



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

def amount
  @amount
end

#descriptionObject

Returns the value of attribute description.



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

def description
  @description
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#quantityObject

Returns the value of attribute quantity.



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

def quantity
  @quantity
end

#shipping_costObject

Returns the value of attribute shipping_cost.



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

def shipping_cost
  @shipping_cost
end

#weightObject

Returns the value of attribute weight.



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

def weight
  @weight
end