Class: Roulette::Transaction

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Transaction

Returns a new instance of Transaction.



4
5
6
7
8
# File 'lib/roulette/transaction.rb', line 4

def initialize(options = {})
  self.store = options[:store]
  self.args = *options[:args]
  self.method = options[:method]
end

Instance Attribute Details

#argsObject

Returns the value of attribute args.



2
3
4
# File 'lib/roulette/transaction.rb', line 2

def args
  @args
end

#methodObject

Returns the value of attribute method.



2
3
4
# File 'lib/roulette/transaction.rb', line 2

def method
  @method
end

#storeObject

Returns the value of attribute store.



2
3
4
# File 'lib/roulette/transaction.rb', line 2

def store
  @store
end

Instance Method Details

#fire(method_name = nil) ⇒ Object



10
11
12
13
# File 'lib/roulette/transaction.rb', line 10

def fire(method_name = nil )
  method_to_fire = (method_name||method).to_sym
  store.send method_to_fire, *args
end