Sha256: bc3f4b2e35495d75cf735d811b3a806523ae9bd05ed6686d780ec47d4dd8d004
Contents?: true
Size: 815 Bytes
Versions: 16
Compression:
Stored size: 815 Bytes
Contents
module Saucy class Layouts def initialize @controllers = {} end def method_missing(controller_name, *args, &block) @controllers[controller_name.to_s] ||= Controller.new end def self.to_proc lambda do |controller| controller_name = controller.controller_name action_name = controller.action_name Saucy::Configuration.layouts.send(controller_name).send(action_name) end end private class Controller def initialize @actions = {} end 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] ||= "application" end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems