Class: Terrazzo::ResourceResolver
- Inherits:
-
Object
- Object
- Terrazzo::ResourceResolver
- Defined in:
- lib/terrazzo/resource_resolver.rb
Instance Attribute Summary collapse
-
#controller_path ⇒ Object
readonly
Returns the value of attribute controller_path.
Instance Method Summary collapse
- #dashboard_class ⇒ Object
-
#initialize(controller_path) ⇒ ResourceResolver
constructor
A new instance of ResourceResolver.
- #namespace ⇒ Object
- #resource_class ⇒ Object
- #resource_title ⇒ Object
Constructor Details
#initialize(controller_path) ⇒ ResourceResolver
Returns a new instance of ResourceResolver.
5 6 7 |
# File 'lib/terrazzo/resource_resolver.rb', line 5 def initialize(controller_path) @controller_path = controller_path end |
Instance Attribute Details
#controller_path ⇒ Object (readonly)
Returns the value of attribute controller_path.
3 4 5 |
# File 'lib/terrazzo/resource_resolver.rb', line 3 def controller_path @controller_path end |
Instance Method Details
#dashboard_class ⇒ Object
9 10 11 |
# File 'lib/terrazzo/resource_resolver.rb', line 9 def dashboard_class "#{resource_class_name}Dashboard".constantize end |
#namespace ⇒ Object
17 18 19 20 |
# File 'lib/terrazzo/resource_resolver.rb', line 17 def namespace parts = controller_path.split("/") parts.first.to_sym if parts.length > 1 end |
#resource_class ⇒ Object
13 14 15 |
# File 'lib/terrazzo/resource_resolver.rb', line 13 def resource_class resource_class_name.constantize end |
#resource_title ⇒ Object
22 23 24 |
# File 'lib/terrazzo/resource_resolver.rb', line 22 def resource_title resource_class.model_name.human end |