Created
December 12, 2009 16:04
-
-
Save kusor/254946 to your computer and use it in GitHub Desktop.
Sinatra HTTP Options
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Sinatra | |
class Base | |
def self.http_options(path, opts={}, &bk) | |
route('OPTIONS', path, opts, &bk ) | |
end | |
end | |
module Delegator | |
delegate :http_options | |
end | |
end | |
module Rack | |
module Test | |
class Session | |
def http_options(uri, params = {}, env = {}, &block) | |
env = env_for(uri, env.merge(:method => "OPTIONS", :params => params)) | |
process_request(uri, env, &block) | |
end | |
end | |
module Methods | |
def_delegator :current_session, :http_options | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment