Class: PikoTransaction::TransactionHolder
- Inherits:
-
Object
- Object
- PikoTransaction::TransactionHolder
- Includes:
- Logger
- Defined in:
- lib/piko_transaction/transaction_holder.rb
Instance Method Summary collapse
-
#initialize ⇒ TransactionHolder
constructor
A new instance of TransactionHolder.
- #method_missing(method_name, *args, &block) ⇒ Object
Methods included from Logger
Constructor Details
#initialize ⇒ TransactionHolder
Returns a new instance of TransactionHolder.
27 28 29 |
# File 'lib/piko_transaction/transaction_holder.rb', line 27 def initialize @transactions = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
31 32 33 34 35 |
# File 'lib/piko_transaction/transaction_holder.rb', line 31 def method_missing(method_name, *args, &block) logger.debug { format "Looking for transaction '%s'", method_name } return super unless valid_method_name?(method_name) @transactions[method_name] ||= Transaction.new method_name end |