Module: HTTPrb
- Defined in:
- lib/httprb.rb,
lib/httprb/dsl.rb,
lib/httprb/request.rb,
lib/httprb/version.rb,
lib/httprb/delegate.rb,
lib/httprb/http_cache.rb
Defined Under Namespace
Modules: Delegator Classes: HTTPCache, Request
Constant Summary collapse
- VERSION =
HTTPrb version
'0.1.3'
- VERSION_ARRAY =
:nodoc:
VERSION.split(/\./).map { |x| x.to_i }
- VERSION_MAJOR =
:nodoc:
VERSION_ARRAY[0]
- VERSION_MINOR =
:nodoc:
VERSION_ARRAY[1]
- VERSION_BUILD =
:nodoc:
VERSION_ARRAY[2]
Class Method Summary collapse
-
.delete(url, options = {}) {|req| ... } ⇒ Object
delete request.
-
.get(url, options = {}) {|req| ... } ⇒ Object
get request.
-
.head(url, options = {}) {|req| ... } ⇒ Object
head request.
-
.post(url, options = {}) {|req| ... } ⇒ Object
post request.
-
.put(url, options = {}) {|req| ... } ⇒ Object
put request.
Class Method Details
.delete(url, options = {}) {|req| ... } ⇒ Object
delete request
-
options are not generally used; HTTPrb::Request offers additional methods for option generation/ handling.
-
accepts a block, handing off the HTTPrb::Request object to it, if provided.
84 85 86 87 88 89 |
# File 'lib/httprb/dsl.rb', line 84 def HTTPrb.delete(url, = {}) [:type] = 'DELETE' req = Request.new(url, ) yield(req) if block_given? HTTPrb::HTTPCache.instance.make_request(req) end |
.get(url, options = {}) {|req| ... } ⇒ Object
get request
-
options are not generally used; HTTPrb::Request offers additional methods for option generation/ handling.
-
accepts a block, handing off the HTTPrb::Request object to it, if provided.
28 29 30 31 32 33 |
# File 'lib/httprb/dsl.rb', line 28 def HTTPrb.get(url, = {}) [:type] = 'GET' req = Request.new(url, ) yield(req) if block_given? HTTPrb::HTTPCache.instance.make_request(req) end |
.head(url, options = {}) {|req| ... } ⇒ Object
head request
-
options are not generally used; HTTPrb::Request offers additional methods for option generation/ handling.
-
accepts a block, handing off the HTTPrb::Request object to it, if provided.
42 43 44 45 46 47 |
# File 'lib/httprb/dsl.rb', line 42 def HTTPrb.head(url, = {}) [:type] = 'HEAD' req = Request.new(url, ) yield(req) if block_given? HTTPrb::HTTPCache.instance.make_request(req) end |
.post(url, options = {}) {|req| ... } ⇒ Object
post request
-
options are not generally used; HTTPrb::Request offers additional methods for option generation/ handling.
-
accepts a block, handing off the HTTPrb::Request object to it, if provided.
56 57 58 59 60 61 |
# File 'lib/httprb/dsl.rb', line 56 def HTTPrb.post(url, = {}) [:type] = 'POST' req = Request.new(url, ) yield(req) if block_given? HTTPrb::HTTPCache.instance.make_request(req) end |
.put(url, options = {}) {|req| ... } ⇒ Object
put request
-
options are not generally used; HTTPrb::Request offers additional methods for option generation/ handling.
-
accepts a block, handing off the HTTPrb::Request object to it, if provided.
70 71 72 73 74 75 |
# File 'lib/httprb/dsl.rb', line 70 def HTTPrb.put(url, = {}) [:type] = 'PUT' req = Request.new(url, ) yield(req) if block_given? HTTPrb::HTTPCache.instance.make_request(req) end |