Sha256: fe856e54efbab639da31ec0125cca8f813e30d24cabeed88213e40f504afe579

Contents?: true

Size: 1.08 KB

Versions: 5

Compression:

Stored size: 1.08 KB

Contents

class Tynn
  # Public: It provides convenience methods for pulling out information
  # from a request.
  #
  # Examples
  #
  #   env = {
  #     "REQUEST_METHOD" => "GET"
  #     "QUERY_STRING"   => "email=me@tynn.xyz"
  #   }
  #
  #   req = Tynn::Request.new(env)
  #
  #   req.get?  # => true
  #   req.post? # => false
  #
  #   req.params  # => { "email" => "me@tynn.xyz" }
  #   req[:email] # => "me@tynn.xyz"
  #
  class Request < Rack::Request
    # Public: Returns the value of the +key+ param.
    #
    # key - Any object that responds to +to_s+.
    #
    # Examples
    #
    #   req.params
    #   # => { "username" => "bob" }
    #
    #   req[:username]  # => "bob"
    #   req["username"] # => "bob"
    #
    # Signature
    #
    #   [](key)
    #
    # Inherited by Rack::Request.

    # Public: Returns a Hash of parameters. Includes data from the query
    # string and the response body.
    #
    # Examples
    #
    #   req.params
    #   # => { "user" => { "username" => "bob" } }
    #
    # Signature
    #
    #   params()
    #
    # Inherited by Rack::Request.
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tynn-1.4.0 lib/tynn/request.rb
tynn-1.3.0 lib/tynn/request.rb
tynn-1.2.0 lib/tynn/request.rb
tynn-1.1.0 lib/tynn/request.rb
tynn-1.0.0 lib/tynn/request.rb