Class: StateMachines::HelperModule

Inherits:
Module
  • Object
show all
Defined in:
lib/state_machines/helper_module.rb

Overview

Represents a type of module that defines instance / class methods for a state machine

Instance Method Summary collapse

Constructor Details

#initialize(machine, kind) ⇒ HelperModule

:nodoc:



5
6
7
8
# File 'lib/state_machines/helper_module.rb', line 5

def initialize(machine, kind)
  @machine = machine
  @kind = kind
end

Instance Method Details

#to_sObject

Provides a human-readable description of the module



11
12
13
14
15
# File 'lib/state_machines/helper_module.rb', line 11

def to_s
  owner_class = @machine.owner_class
  owner_class_name = owner_class.name && !owner_class.name.empty? ? owner_class.name : owner_class.to_s
  "#{owner_class_name} #{@machine.name.inspect} #{@kind} helpers"
end