Class: PagseguroCatcher::Transaction::Amount

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

Instance Attribute Summary

Attributes inherited from Body

#body

Instance Method Summary collapse

Methods inherited from Body

#[], #method_missing

Constructor Details

#initialize(body) ⇒ Amount

Returns a new instance of Amount.



6
7
8
# File 'lib/pagseguro_catcher/transaction/amount.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

#discountObject



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

def discount
  self[:discountAmount].to_f
end

#extraObject



26
27
28
# File 'lib/pagseguro_catcher/transaction/amount.rb', line 26

def extra
  self[:extraAmount].to_f
end

#feeObject



18
19
20
# File 'lib/pagseguro_catcher/transaction/amount.rb', line 18

def fee
  self[:feeAmount].to_f
end

#grossObject



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

def gross
  self[:grossAmount].to_f
end

#netObject



22
23
24
# File 'lib/pagseguro_catcher/transaction/amount.rb', line 22

def net
  self[:netAmount].to_f
end