Class: StateMachine::State

Inherits:
Object
  • Object
show all
Defined in:
lib/state_machine/i18n.rb

Instance Method Summary collapse

Instance Method Details

#human_name(*_args) ⇒ Object Also known as: localize


3
4
5
6
# File 'lib/state_machine/i18n.rb', line 3

def human_name(*_args)
  class_name = @machine.owner_class.name.underscore
  "state_machines.#{class_name}.states.#{@name}".t(default: ["models.#{class_name}.state_machine.states.#{@name}".to_sym, "models.#{class_name}.states.#{@name}".to_sym, @name.to_s.humanize])
end