Class: StateFu::Executioner

Inherits:
Object show all
Defined in:
lib/executioner.rb

Overview

class that handles executing stuff in the context of your 'object'

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Executioner) initialize(transition, &block)



10
11
12
13
14
# File 'lib/executioner.rb', line 10

def initialize transition, &block
  @transition = transition
  @object     = transition.object
  self
end

Instance Attribute Details

- (Object) object (readonly)

Returns the value of attribute object



8
9
10
# File 'lib/executioner.rb', line 8

def object
  @object
end

- (Object) transition (readonly)

Returns the value of attribute transition



8
9
10
# File 'lib/executioner.rb', line 8

def transition
  @transition
end

Instance Method Details

- (Object) evaluate(method_name_or_proc)



16
17
18
19
# File 'lib/executioner.rb', line 16

def evaluate method_name_or_proc
  args = [transition, transition.arguments]
  evaluate_with_arguments(method_name_or_proc, *args)
end