Class: Flutie::PageTitlePresenter
- Inherits:
-
Object
- Object
- Flutie::PageTitlePresenter
- Defined in:
- lib/flutie/page_title_presenter.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#app_name ⇒ Object
readonly
Returns the value of attribute app_name.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#reversed ⇒ Object
readonly
Returns the value of attribute reversed.
-
#separator ⇒ Object
readonly
Returns the value of attribute separator.
Instance Method Summary collapse
-
#initialize(app_name, content, separator, reversed = false) ⇒ PageTitlePresenter
constructor
A new instance of PageTitlePresenter.
- #ordered_parts ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(app_name, content, separator, reversed = false) ⇒ PageTitlePresenter
Returns a new instance of PageTitlePresenter.
7 8 9 10 11 12 |
# File 'lib/flutie/page_title_presenter.rb', line 7 def initialize(app_name, content, separator, reversed = false) @app_name = app_name @content = content @separator = separator @reversed = reversed end |
Instance Attribute Details
#app_name ⇒ Object (readonly)
Returns the value of attribute app_name.
5 6 7 |
# File 'lib/flutie/page_title_presenter.rb', line 5 def app_name @app_name end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
5 6 7 |
# File 'lib/flutie/page_title_presenter.rb', line 5 def content @content end |
#reversed ⇒ Object (readonly)
Returns the value of attribute reversed.
5 6 7 |
# File 'lib/flutie/page_title_presenter.rb', line 5 def reversed @reversed end |
#separator ⇒ Object (readonly)
Returns the value of attribute separator.
5 6 7 |
# File 'lib/flutie/page_title_presenter.rb', line 5 def separator @separator end |
Instance Method Details
#ordered_parts ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/flutie/page_title_presenter.rb', line 18 def ordered_parts if reversed_order? [content, app_name] else [app_name, content] end end |
#to_s ⇒ Object
14 15 16 |
# File 'lib/flutie/page_title_presenter.rb', line 14 def to_s ordered_parts.compact.join(separator) end |