Class: TitleHelper::PageTitle
- Inherits:
-
Object
- Object
- TitleHelper::PageTitle
- Defined in:
- lib/pineapples/templates/app/helpers/title_helper.rb
Instance Attribute Summary collapse
-
#action_name ⇒ Object
readonly
Returns the value of attribute action_name.
-
#application_name ⇒ Object
readonly
Returns the value of attribute application_name.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#controller_path ⇒ Object
readonly
Returns the value of attribute controller_path.
-
#include_application_name ⇒ Object
readonly
Returns the value of attribute include_application_name.
-
#separator ⇒ Object
readonly
Returns the value of attribute separator.
Instance Method Summary collapse
-
#initialize(controller_path, action_name, context, opts) ⇒ PageTitle
constructor
A new instance of PageTitle.
- #to_s ⇒ Object
Constructor Details
#initialize(controller_path, action_name, context, opts) ⇒ PageTitle
Returns a new instance of PageTitle.
16 17 18 19 20 21 22 23 |
# File 'lib/pineapples/templates/app/helpers/title_helper.rb', line 16 def initialize(controller_path, action_name, context, opts) @controller_path = controller_path @action_name = action_name @context = context @application_name = opts[:application_name] || humanized_application_name @include_application_name = opts[:include_application_name] || true @separator = opts[:separator] || ' – ' end |
Instance Attribute Details
#action_name ⇒ Object (readonly)
Returns the value of attribute action_name.
13 14 15 |
# File 'lib/pineapples/templates/app/helpers/title_helper.rb', line 13 def action_name @action_name end |
#application_name ⇒ Object (readonly)
Returns the value of attribute application_name.
13 14 15 |
# File 'lib/pineapples/templates/app/helpers/title_helper.rb', line 13 def application_name @application_name end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
13 14 15 |
# File 'lib/pineapples/templates/app/helpers/title_helper.rb', line 13 def context @context end |
#controller_path ⇒ Object (readonly)
Returns the value of attribute controller_path.
13 14 15 |
# File 'lib/pineapples/templates/app/helpers/title_helper.rb', line 13 def controller_path @controller_path end |
#include_application_name ⇒ Object (readonly)
Returns the value of attribute include_application_name.
13 14 15 |
# File 'lib/pineapples/templates/app/helpers/title_helper.rb', line 13 def include_application_name @include_application_name end |
#separator ⇒ Object (readonly)
Returns the value of attribute separator.
13 14 15 |
# File 'lib/pineapples/templates/app/helpers/title_helper.rb', line 13 def separator @separator end |
Instance Method Details
#to_s ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/pineapples/templates/app/helpers/title_helper.rb', line 25 def to_s title = translate_action if include_application_name title << "#{separator}#{application_name}" if title != application_name end title end |