Class: Fumoffu::Controller
Direct Known Subclasses
Instance Attribute Summary collapse
-
#action_name ⇒ Object
Returns the value of attribute action_name.
-
#controller_name ⇒ Object
readonly
Returns the value of attribute controller_name.
Instance Method Summary collapse
- #extract_controller_name ⇒ Object
-
#initialize ⇒ Controller
constructor
A new instance of Controller.
Constructor Details
#initialize ⇒ Controller
Returns a new instance of Controller.
6 7 8 |
# File 'lib/fumoffu/controller.rb', line 6 def initialize @controller_name = extract_controller_name end |
Instance Attribute Details
#action_name ⇒ Object
Returns the value of attribute action_name.
3 4 5 |
# File 'lib/fumoffu/controller.rb', line 3 def action_name @action_name end |
#controller_name ⇒ Object (readonly)
Returns the value of attribute controller_name.
4 5 6 |
# File 'lib/fumoffu/controller.rb', line 4 def controller_name @controller_name end |
Instance Method Details
#extract_controller_name ⇒ Object
10 11 12 13 |
# File 'lib/fumoffu/controller.rb', line 10 def extract_controller_name name = self.class.to_s name.scan(/^\w+Controller$/).first.downcase end |