Class: Theme::Presenters::ThemePresenter
- Inherits:
-
Object
- Object
- Theme::Presenters::ThemePresenter
- Extended by:
- Forwardable
- Defined in:
- lib/project_types/theme/presenters/theme_presenter.rb
Constant Summary collapse
- COLOR_BY_ROLE =
{ "live" => "green", "unpublished" => "yellow", "development" => "blue", }
Instance Attribute Summary collapse
-
#theme ⇒ Object
readonly
Returns the value of attribute theme.
Instance Method Summary collapse
-
#initialize(theme) ⇒ ThemePresenter
constructor
A new instance of ThemePresenter.
- #to_s(mode = :long) ⇒ Object
Constructor Details
#initialize(theme) ⇒ ThemePresenter
Returns a new instance of ThemePresenter.
20 21 22 |
# File 'lib/project_types/theme/presenters/theme_presenter.rb', line 20 def initialize(theme) @theme = theme end |
Instance Attribute Details
#theme ⇒ Object (readonly)
Returns the value of attribute theme.
16 17 18 |
# File 'lib/project_types/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/project_types/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 |