Class: RailsStateMachine::State

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_state_machine/state.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, **options) ⇒ State

Returns a new instance of State.



5
6
7
8
# File 'lib/rails_state_machine/state.rb', line 5

def initialize(name, **options)
  @name = name
  @options = options
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/rails_state_machine/state.rb', line 3

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/rails_state_machine/state.rb', line 3

def options
  @options
end

Instance Method Details

#initial?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/rails_state_machine/state.rb', line 10

def initial?
  !!options[:initial]
end