Class: Theme::Presenters::ThemesPresenter
- Inherits:
-
Object
- Object
- Theme::Presenters::ThemesPresenter
- Defined in:
- lib/project_types/theme/presenters/themes_presenter.rb
Constant Summary collapse
- SUPPORTED_ROLES =
%w(live unpublished development)
Instance Method Summary collapse
- #all ⇒ Object
-
#initialize(ctx, root) ⇒ ThemesPresenter
constructor
A new instance of ThemesPresenter.
Constructor Details
#initialize(ctx, root) ⇒ ThemesPresenter
Returns a new instance of ThemesPresenter.
10 11 12 13 |
# File 'lib/project_types/theme/presenters/themes_presenter.rb', line 10 def initialize(ctx, root) @ctx = ctx @root = root end |
Instance Method Details
#all ⇒ Object
15 16 17 18 19 20 |
# File 'lib/project_types/theme/presenters/themes_presenter.rb', line 15 def all all_themes .select { |theme| SUPPORTED_ROLES.include?(theme.role) } .sort_by { |theme| SUPPORTED_ROLES.index(theme.role) } .map { |theme| ThemePresenter.new(theme) } end |