Class: PagseguroCatcher::Transaction::Item

Inherits:
Body
  • Object
show all
Defined in:
lib/pagseguro_catcher/transaction/item.rb

Instance Attribute Summary

Attributes inherited from Body

#body

Instance Method Summary collapse

Methods inherited from Body

#[], #method_missing

Constructor Details

#initialize(body) ⇒ Item

Returns a new instance of Item.



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

def initialize(body)
  self.body = body
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PagseguroCatcher::Transaction::Body

Instance Method Details

#amountObject



14
15
16
# File 'lib/pagseguro_catcher/transaction/item.rb', line 14

def amount
  self[:amount].to_f
end

#idObject



10
11
12
# File 'lib/pagseguro_catcher/transaction/item.rb', line 10

def id
  self[:id].to_i
end