Module: Mutator::Helpers

Defined in:
lib/mutator/helpers.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/mutator/helpers.rb', line 7

def self.included base
  Mutator.const_get(base.name, false).states.each do |state|
    base.send(:define_singleton_method, state) do
      where state: state
    end
  end
end

Instance Method Details

#machineObject



3
4
5
# File 'lib/mutator/helpers.rb', line 3

def machine
  @machine ||= machine_class.new(self)
end