Module: PowerApi::GeneratorHelper::ControllerActionsHelper

Extended by:
ActiveSupport::Concern
Included in:
PowerApi::GeneratorHelpers
Defined in:
lib/power_api/generator_helper/controller_actions_helper.rb

Constant Summary collapse

PERMITTED_ACTIONS =
['index', 'create', 'show', 'update', 'destroy']

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#controller_actionsObject

Returns the value of attribute controller_actions.



6
7
8
# File 'lib/power_api/generator_helper/controller_actions_helper.rb', line 6

def controller_actions
  @controller_actions
end

Instance Method Details

#collection_actions?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/power_api/generator_helper/controller_actions_helper.rb', line 20

def collection_actions?
  index? || create?
end

#resource_actions?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/power_api/generator_helper/controller_actions_helper.rb', line 16

def resource_actions?
  show? || update? || destroy?
end

#update_or_create?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/power_api/generator_helper/controller_actions_helper.rb', line 24

def update_or_create?
  update? || create?
end