Class: FluidCLI::Theme::Presenters::ThemePresenter

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/fluid_cli/theme/presenters/theme_presenter.rb

Constant Summary collapse

COLOR_BY_STATUS =
{
  "active" => "green",
  "draft" => "yellow",
  "development" => "blue",
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(theme) ⇒ ThemePresenter

Returns a new instance of ThemePresenter.



20
21
22
# File 'lib/fluid_cli/theme/presenters/theme_presenter.rb', line 20

def initialize(theme)
  @theme = theme
end

Instance Attribute Details

#themeObject (readonly)

Returns the value of attribute theme.



16
17
18
# File 'lib/fluid_cli/theme/presenters/theme_presenter.rb', line 16

def theme
  @theme
end

Instance Method Details

#to_s(mode = :long) ⇒ Object



24
25
26
27
28
29
30
31
32
33
# File 'lib/fluid_cli/theme/presenters/theme_presenter.rb', line 24

def to_s(mode = :long)
  case mode
  when :short
    "{{bold:#{name}}}"
  when :long
    "{{green:##{id}}} {{bold:#{name}}}"
  else
    inspect
  end
end