Module: Upgrow::Actions
Overview
This module offers helpers to work with the collection of Actions loaded in the application.
Actions are created with a concrete, predefined interface. This allows them to be uniformly instantiated in the context of an application, which is helpful to prevent duplications.
Instance Method Summary collapse
-
#[](*names) ⇒ Action
Convenience method to retrieve an Action based on a key name optionally namespaced.
Instance Method Details
#[](*names) ⇒ Action
Convenience method to retrieve an Action based on a key name optionally namespaced.
26 27 28 29 |
# File 'lib/upgrow/actions.rb', line 26 def [](*names) action_class_name = "#{names.map(&:capitalize).join("::")}Action" Object.const_get(action_class_name) end |