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::#{base.name}".constantize.states.each do |state| base.send(:define_singleton_method, state) do self.where(state: state) end end end |
Instance Method Details
#machine ⇒ Object
3 4 5 |
# File 'lib/mutator/helpers.rb', line 3 def machine @machine ||= machine_class.new(self) end |