Class: ActionHero::ActionResolver
- Inherits:
-
Object
- Object
- ActionHero::ActionResolver
- Defined in:
- lib/action_hero/action_resolver.rb
Instance Attribute Summary collapse
-
#action_name ⇒ Object
readonly
Returns the value of attribute action_name.
-
#module_name ⇒ Object
readonly
Returns the value of attribute module_name.
Instance Method Summary collapse
- #action_class ⇒ Object
- #action_class_file_exists? ⇒ Boolean
- #action_class_name ⇒ Object
-
#initialize(options) ⇒ ActionResolver
constructor
A new instance of ActionResolver.
Constructor Details
#initialize(options) ⇒ ActionResolver
Returns a new instance of ActionResolver.
7 8 9 10 |
# File 'lib/action_hero/action_resolver.rb', line 7 def initialize( ) @module_name = normalize_controller( ) @action_name = [:action_name] end |
Instance Attribute Details
#action_name ⇒ Object (readonly)
Returns the value of attribute action_name.
4 5 6 |
# File 'lib/action_hero/action_resolver.rb', line 4 def action_name @action_name end |
#module_name ⇒ Object (readonly)
Returns the value of attribute module_name.
4 5 6 |
# File 'lib/action_hero/action_resolver.rb', line 4 def module_name @module_name end |
Instance Method Details
#action_class ⇒ Object
12 13 14 |
# File 'lib/action_hero/action_resolver.rb', line 12 def action_class @action_class ||= action_class_name.constantize end |
#action_class_file_exists? ⇒ Boolean
23 24 25 |
# File 'lib/action_hero/action_resolver.rb', line 23 def action_class_file_exists? File.exists?( Rails.root.join( 'app', 'actions', "#{action_class_name.underscore}.rb" )) end |
#action_class_name ⇒ Object
16 17 18 19 20 21 |
# File 'lib/action_hero/action_resolver.rb', line 16 def action_class_name @action_class_name ||= [ module_name, action_name.camelize ].join( '::' ) end |