Class: Decidim::ParticipatorySpaceManifestPresenter
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Decidim::ParticipatorySpaceManifestPresenter
- Defined in:
- decidim-core/app/presenters/decidim/participatory_space_manifest_presenter.rb
Overview
A context aware presenter for participatory space manifest for translations
Instance Attribute Summary collapse
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
Instance Method Summary collapse
- #human_name(count: 1) ⇒ Object
-
#initialize(manifest, organization) ⇒ ParticipatorySpaceManifestPresenter
constructor
A new instance of ParticipatorySpaceManifestPresenter.
- #model_class ⇒ Object
Constructor Details
#initialize(manifest, organization) ⇒ ParticipatorySpaceManifestPresenter
Returns a new instance of ParticipatorySpaceManifestPresenter.
8 9 10 11 12 |
# File 'decidim-core/app/presenters/decidim/participatory_space_manifest_presenter.rb', line 8 def initialize(manifest, organization) super(manifest) @organization = organization end |
Instance Attribute Details
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
6 7 8 |
# File 'decidim-core/app/presenters/decidim/participatory_space_manifest_presenter.rb', line 6 def organization @organization end |
Instance Method Details
#human_name(count: 1) ⇒ Object
14 15 16 17 18 |
# File 'decidim-core/app/presenters/decidim/participatory_space_manifest_presenter.rb', line 14 def human_name(count: 1) organization.available_locales.index_with do |locale| model_class.model_name.human(count:, locale:) end end |
#model_class ⇒ Object
20 21 22 |
# File 'decidim-core/app/presenters/decidim/participatory_space_manifest_presenter.rb', line 20 def model_class model_class_name.constantize end |