Class: Saucy::Layouts::Controller

Inherits:
Object
  • Object
show all
Defined in:
lib/saucy/layouts.rb

Instance Method Summary collapse

Constructor Details

#initializeController

Returns a new instance of Controller.



22
23
24
# File 'lib/saucy/layouts.rb', line 22

def initialize
  @actions = {}
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, &block) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/saucy/layouts.rb', line 26

def method_missing(method_name, *args, &block)
  action_name = method_name.to_s
  if action_name.sub!(/=$/, '')
    @actions[action_name] = args.first
  else
    @actions[action_name] ||= "saucy"
  end
end