Module: Cathode::ActionDsl
Overview
Holds the domain-specific language (DSL) for describing actions.
Instance Method Summary collapse
-
#actions ⇒ Array
Lists all the actions; initializes an empty ‘ObjectCollection` if there aren’t any yet.
-
#custom_actions ⇒ Array
Lists the actions that are not default.
-
#default_actions ⇒ Array
Lists the actions that are default (i.e., ‘index`, `show`, `create`, `update`, and `destroy`).
Instance Method Details
#actions ⇒ Array
Lists all the actions; initializes an empty ‘ObjectCollection` if there aren’t any yet
20 21 22 |
# File 'lib/cathode/action_dsl.rb', line 20 def actions @actions ||= ObjectCollection.new end |
#custom_actions ⇒ Array
Lists the actions that are not default
13 14 15 |
# File 'lib/cathode/action_dsl.rb', line 13 def custom_actions actions - default_actions end |
#default_actions ⇒ Array
Lists the actions that are default (i.e., ‘index`, `show`, `create`,
`update`, and `destroy`)
7 8 9 |
# File 'lib/cathode/action_dsl.rb', line 7 def default_actions actions.select { |action| DEFAULT_ACTIONS.include? action.name } end |