Sha256: 46b5a919f6f0593b1e159346705b0f3bf1014a39897bfc7d24755d6d27d59387

Contents?: true

Size: 1.02 KB

Versions: 7

Compression:

Stored size: 1.02 KB

Contents

# Includes files into the class to allow it to minimally delegates to a web controller
module Merb
  module Mixins
    module WebController
      
      def self.included(base)
        [:content_type, :web_controller].each do |attr|
          base.send(:attr_accessor, attr)
        end
        base.send(:include, InstanceMethods)
        base.send(:extend, ClassMethods)
      end
      
      module InstanceMethods
        def request
           @web_controller.request  
        end

        def cookies
          @web_controller.cookies
        end  

        def headers
          @web_controller.headers
        end

        def session
          @web_controller.session
        end

        def response
          @web_controller.response
        end    

        def route
          request.route
        end

        def url(name, *args)
          @web_controller.url(name, *args)
        end
        
      end
      
      module ClassMethods
        
      end
      
      
      
    end # WebController
  end # Mixins
end # Merb

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
merb_parts-0.9.14 lib/merb_parts/mixins/web_controller.rb
merb-parts-0.9.8 lib/merb-parts/mixins/web_controller.rb
merb_parts-0.9.11 lib/merb_parts/mixins/web_controller.rb
merb_parts-0.9.13 lib/merb_parts/mixins/web_controller.rb
merb_parts-0.9.10 lib/merb_parts/mixins/web_controller.rb
merb_parts-0.9.12 lib/merb_parts/mixins/web_controller.rb
merb_parts-0.9.9 lib/merb-parts/mixins/web_controller.rb