Class: TransitionButtons::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/transition_buttons/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



15
16
17
18
19
# File 'lib/transition_buttons/configuration.rb', line 15

def initialize
  @state_machine_adapter = StateMachineAdapters::StateMachines.new
  @authorizer = Authorizers::ActionPolicy.new
  @default_machine = :state
end

Instance Attribute Details

#authorizerObject

Object responding to #permitted?(user:, record:, event:, machine:).



10
11
12
# File 'lib/transition_buttons/configuration.rb', line 10

def authorizer
  @authorizer
end

#default_machineObject

Machine to target when a helper/endpoint does not specify one.



13
14
15
# File 'lib/transition_buttons/configuration.rb', line 13

def default_machine
  @default_machine
end

#state_machine_adapterObject

Object responding to #available_events, #current_state, #fire, #event_label.



7
8
9
# File 'lib/transition_buttons/configuration.rb', line 7

def state_machine_adapter
  @state_machine_adapter
end