Sha256: e265eeb1344491b9a2b49c0de74ca520ca93ae9927cea74e34c3a93533f260fd

Contents?: true

Size: 1.79 KB

Versions: 11

Compression:

Stored size: 1.79 KB

Contents

# coding: utf-8

module UzuUzu
  #
  #
  #
  module Helper
    #
    #
    #
    module Controller
      #
      #
      #
      def logger
        ::UzuUzu.logger
      end
      
      #
      #
      #
      def application
        ::UzuUzu.current
      end
      
      #
      #
      #
      def controller
        ::UzuUzu.controller
      end
      
      #
      #
      #
      def request
        ::UzuUzu.request
      end
  
      #
      #
      #
      def response
        ::UzuUzu.response
      end
      
      #
      #
      #
      def helper
        ::UzuUzu.helper
      end
      
      #
      #
      #
      def action
        Thread.current[:action]
      end
      
      #
      #
      #
      def query
        Thread.current[:query]
      end
      
      #
      #
      #
      def route
        Thread.current[:route]
      end
  
      #
      #
      #
      def session
        request.session
      end
      
      #
      #
      #
      def service
        ::UzuUzu.service
      end
      
      #
      #
      #
      def h(s)
        Rack::Utils.escape(s)
      end
      
      #
      #
      #
      def u(s)
        Rack::Utils.unescape(s)
      end
      
      #
      #
      #
      def query_string(query_options={})
        return "" if query_options.blank?
        query_string = []
        query_options do |key, value|
          query_string << "#{key}=#{value}"
        end
        return "" if query_string.blank?
        "?#{query_string.join('&')}"
      end
      
      #
      #
      #
      def instance_variable_map(instance)
        map = {}
        instance.instance_variables.each do |variable_name|
          map[variable_name] = instance.instance_variable_get(variable_name)
        end
        map
      end
    end # Controller
  end # Helper
end # UzuUzu

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
uzuuzu-core-0.1.10 lib/uzuuzu-core/helper/controller.rb
uzuuzu-core-0.1.8 lib/uzuuzu-core/helper/controller.rb
uzuuzu-core-0.1.7 lib/uzuuzu-core/helper/controller.rb
uzuuzu-core-0.1.6 lib/uzuuzu-core/helper/controller.rb
uzuuzu-core-0.1.5 lib/uzuuzu-core/helper/controller.rb
uzuuzu-core-0.1.4 lib/uzuuzu-core/helper/controller.rb
uzuuzu-core-0.1.3 lib/uzuuzu-core/helper/controller.rb
uzuuzu-core-0.1.2.001 lib/uzuuzu-core/helper/controller.rb
uzuuzu-core-0.1.2 lib/uzuuzu-core/helper/controller.rb
uzuuzu-core-0.1.1 lib/uzuuzu-core/helper/controller.rb
uzuuzu-core-0.1.0 lib/uzuuzu-core/helper/controller.rb