Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/has_state_machine/core_ext/string.rb

Direct Known Subclasses

HasStateMachine::State

Instance Method Summary collapse

Instance Method Details

#transition_to(_desired_state) ⇒ Boolean

Adding our transition method to the default String class to prevent exceptions while transitioning from an invalid state. This method gets overwritten by valid HasStateMachine::State classes.

Examples:

"some random string".transition_to("draft") #=> false

Returns:

  • (Boolean)

    false



13
14
15
# File 'lib/has_state_machine/core_ext/string.rb', line 13

def transition_to(_desired_state)
  false
end