Class: PagseguroCatcher::Transaction::Body

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

Direct Known Subclasses

Amount, Base, Item, Sender, Shipping

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



11
12
13
14
# File 'lib/pagseguro_catcher/transaction.rb', line 11

def method_missing(name, *args)
  return self[name] if self.body.has_key?(name.to_sym)
  super
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



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

def body
  @body
end

Instance Method Details

#[](param) ⇒ Object



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

def [](param)
  self.body[param.to_sym]
end