Class: Fumoffu::Controller

Inherits:
Object show all
Defined in:
lib/fumoffu/controller.rb

Direct Known Subclasses

ApplicationController

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeController

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_nameObject

Returns the value of attribute action_name.



3
4
5
# File 'lib/fumoffu/controller.rb', line 3

def action_name
  @action_name
end

#controller_nameObject (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_nameObject



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.first.downcase
end