Module: Reactor::ResourceActionable

Extended by:
ActiveSupport::Concern
Defined in:
lib/reactor/controllers/concerns/actions/new_event.rb,
lib/reactor/controllers/concerns/actions/edit_event.rb,
lib/reactor/controllers/concerns/actions/show_event.rb,
lib/reactor/controllers/concerns/actions/index_event.rb,
lib/reactor/controllers/concerns/resource_actionable.rb,
lib/reactor/controllers/concerns/actions/action_event.rb,
lib/reactor/controllers/concerns/actions/create_event.rb,
lib/reactor/controllers/concerns/actions/update_event.rb,
lib/reactor/controllers/concerns/actions/destroy_event.rb

Defined Under Namespace

Modules: ClassMethods Classes: ActionEvent, CreateEvent, DestroyEvent, EditEvent, IndexEvent, NewEvent, ShowEvent, UpdateEvent

Instance Method Summary collapse

Instance Method Details

#actionable_resourceObject



37
# File 'lib/reactor/controllers/concerns/resource_actionable.rb', line 37

def actionable_resource; instance_variable_get(self.class.actionable_resource); end

#infer_basic_action_eventObject



9
10
11
12
13
14
15
16
17
# File 'lib/reactor/controllers/concerns/resource_actionable.rb', line 9

def infer_basic_action_event
  yield if block_given?

  if (event_descriptor = "Reactor::ResourceActionable::#{action_name.camelize}Event".safe_constantize).present?
    event_descriptor.perform_on self
  else
    action_event "#{resource_name}_#{action_name}"
  end
end

#nested_resourceObject



38
# File 'lib/reactor/controllers/concerns/resource_actionable.rb', line 38

def nested_resource; self.class.nested_resource && instance_variable_get(self.class.nested_resource); end