Module: Reactor::ResourceActionable

Extended by:
ActiveSupport::Concern
Defined in:
lib/reactor/controllers/concerns/resource_actionable.rb

Defined Under Namespace

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

Instance Method Summary collapse

Instance Method Details

#actionable_resourceObject



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

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

#infer_basic_action_eventObject



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

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



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

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