Class: PageTitle::Base

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/page_title.rb

Constant Summary collapse

ACTION_ALIAS =

Set all action aliases.

{
  "update" => "edit",
  "create" => "new",
  "destroy" => "remove"
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controller) ⇒ Base

Returns a new instance of Base.



26
27
28
29
# File 'lib/page_title.rb', line 26

def initialize(controller)
  @controller = controller
  @options = {}
end

Instance Attribute Details

#controllerObject (readonly)

Set the controller instance. It must implement the methods controller_name and action_name.



18
19
20
# File 'lib/page_title.rb', line 18

def controller
  @controller
end

#optionsObject (readonly)

Set the main translation options.



21
22
23
# File 'lib/page_title.rb', line 21

def options
  @options
end

Instance Method Details

#simpleObject



35
36
37
# File 'lib/page_title.rb', line 35

def simple
  title_translation
end

#to_sObject



31
32
33
# File 'lib/page_title.rb', line 31

def to_s
  base_translation
end