Class: FluidCLI::Theme::Presenters::ThemesPresenter

Inherits:
Object
  • Object
show all
Defined in:
lib/fluid_cli/theme/presenters/themes_presenter.rb

Constant Summary collapse

SUPPORTED_STATUSES =
%w(active draft development)

Instance Method Summary collapse

Constructor Details

#initialize(ctx, root) ⇒ ThemesPresenter

Returns a new instance of ThemesPresenter.



11
12
13
14
# File 'lib/fluid_cli/theme/presenters/themes_presenter.rb', line 11

def initialize(ctx, root)
  @ctx = ctx
  @root = root
end

Instance Method Details

#allObject



16
17
18
19
20
21
# File 'lib/fluid_cli/theme/presenters/themes_presenter.rb', line 16

def all
  all_themes
    .select { |theme| SUPPORTED_STATUSES.include?(theme.status) }
    .sort_by { |theme| SUPPORTED_STATUSES.index(theme.status) }
    .map { |theme| ThemePresenter.new(theme) }
end