Class: PagseguroCatcher::Transaction::Sender

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

Instance Attribute Summary

Attributes inherited from Body

#body

Instance Method Summary collapse

Methods inherited from Body

#[], #method_missing

Constructor Details

#initialize(body) ⇒ Sender

Returns a new instance of Sender.



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

def initialize(body)
  self.body = body[:sender]
end

Dynamic Method Handling

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

Instance Method Details

#emailObject



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

def email
  self[:email]
end

#nameObject



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

def name
  self[:name]
end

#phoneObject



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

def phone
  { :area => self[:phone][:areaCode], :number => self[:phone][:number] }
end