Sha256: 7dad861fa12c3a78c6a2ac5a03b1d3b71f87b42bc887ed1e625d841e686c3a19

Contents?: true

Size: 573 Bytes

Versions: 7

Compression:

Stored size: 573 Bytes

Contents

module Adapters
  
  #
  #
  module Rack
    
    class LiveParameters < Base

      def initialize live_parameters
        @live_parameters = live_parameters
      end
      
      #
      #
      def to_app options = {}
        # For capturing by the lambda block.
        #
        live_parameters = @live_parameters
        
        lambda do |env|
          params = ::Rack::Request.new(env).params
          
          results = live_parameters.parameters params
          
          respond_with results.to_json
        end
      end
      
    end
    
  end
  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
picky-1.4.1 lib/picky/adapters/rack/live_parameters.rb
picky-1.4.0 lib/picky/adapters/rack/live_parameters.rb
picky-1.3.4 lib/picky/adapters/rack/live_parameters.rb
picky-1.3.3 lib/picky/adapters/rack/live_parameters.rb
picky-1.3.2 lib/picky/adapters/rack/live_parameters.rb
picky-1.3.1 lib/picky/adapters/rack/live_parameters.rb
picky-1.3.0 lib/picky/adapters/rack/live_parameters.rb