Class: CurationConcerns::ContextualPath
- Inherits:
-
Object
- Object
- CurationConcerns::ContextualPath
- Includes:
- ActionDispatch::Routing::PolymorphicRoutes
- Defined in:
- app/services/curation_concerns/contextual_path.rb
Instance Attribute Summary collapse
-
#parent_presenter ⇒ Object
readonly
Returns the value of attribute parent_presenter.
-
#presenter ⇒ Object
readonly
Returns the value of attribute presenter.
Instance Method Summary collapse
-
#initialize(presenter, parent_presenter) ⇒ ContextualPath
constructor
A new instance of ContextualPath.
- #show ⇒ Object
Constructor Details
#initialize(presenter, parent_presenter) ⇒ ContextualPath
Returns a new instance of ContextualPath.
6 7 8 9 |
# File 'app/services/curation_concerns/contextual_path.rb', line 6 def initialize(presenter, parent_presenter) @presenter = presenter @parent_presenter = parent_presenter end |
Instance Attribute Details
#parent_presenter ⇒ Object (readonly)
Returns the value of attribute parent_presenter.
5 6 7 |
# File 'app/services/curation_concerns/contextual_path.rb', line 5 def parent_presenter @parent_presenter end |
#presenter ⇒ Object (readonly)
Returns the value of attribute presenter.
5 6 7 |
# File 'app/services/curation_concerns/contextual_path.rb', line 5 def presenter @presenter end |
Instance Method Details
#show ⇒ Object
11 12 13 14 15 16 17 |
# File 'app/services/curation_concerns/contextual_path.rb', line 11 def show if parent_presenter polymorphic_path([:curation_concerns, :parent, presenter.model_name.singular], parent_id: parent_presenter.id, id: presenter.id) else polymorphic_path([presenter]) end end |