Class Statemachine::StubContext
In: lib/statemachine/stub_context.rb
Parent: Object

Methods

Attributes

statemachine  [RW] 

Public Class methods

[Source]

   # File lib/statemachine/stub_context.rb, line 5
5:     def initialize(options = {})
6:       @verbose = options[:verbose]
7:     end

Public Instance methods

[Source]

    # File lib/statemachine/stub_context.rb, line 18
18:     def __generic_method(name, *args)
19:       if !defined?($IS_TEST)
20:         puts "action invoked: #{name}(#{args.join(", ")}) #{block_given? ? "with block" : ""}" if @verbose
21:       end
22:     end

[Source]

    # File lib/statemachine/stub_context.rb, line 11
11:     def method(name)
12:       super(name)
13:     rescue
14:       self.class.class_eval "def #{name}(*args, &block); __generic_method(:#{name}, *args, &block); end"
15:       return super(name)
16:     end

[Validate]