Class: Lucie::Helpers::ControllerName
- Inherits:
-
Object
- Object
- Lucie::Helpers::ControllerName
- Defined in:
- lib/lucie/helpers/controller_name.rb
Overview
Converts controller name from underscore form to capitalized
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #capitalized ⇒ Object
-
#initialize(name) ⇒ ControllerName
constructor
A new instance of ControllerName.
Constructor Details
#initialize(name) ⇒ ControllerName
Returns a new instance of ControllerName.
9 10 11 |
# File 'lib/lucie/helpers/controller_name.rb', line 9 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/lucie/helpers/controller_name.rb', line 7 def name @name end |
Instance Method Details
#capitalized ⇒ Object
13 14 15 |
# File 'lib/lucie/helpers/controller_name.rb', line 13 def capitalized @name.split("_").map{|x| x.capitalize}.join end |