Module: Net
- Defined in:
- flow/net/net.rb,
flow/net/header.rb,
flow/net/config.rb,
flow/net/session.rb,
flow/net/actions.rb,
flow/net/response.rb,
flow/net/stubbable.rb,
flow/net/expectation.rb,
flow/net/authorization.rb
Defined Under Namespace
Modules: Config Classes: Request, Response, Session
Class Method Summary (collapse)
-
+ (Object) build(base_url, &block)
Creates a session with common configuration.
- + (Object) delete(base_url, options) {|response| ... }
- + (Object) get(base_url, options) {|response| ... }
- + (Object) head(base_url, options) {|response| ... }
- + (Object) options(base_url, options) {|response| ... }
- + (Object) patch(base_url, options) {|response| ... }
- + (Object) post(base_url, options) {|response| ... }
- + (Object) put(base_url, options) {|response| ... }
-
+ (Boolean) reachable?(hostname = 'www.google.com', &block)
Track the reachability of a hostname.
-
+ (Object) stub(base_url)
Stub an url to return the desired Response object.
Class Method Details
+ (Object) build(base_url, &block)
Creates a session with common configuration
13 14 15 |
# File 'flow/net/net.rb', line 13 def build(base_url, &block) Session.build(base_url, &block) end |
+ (Object) head(base_url, options) {|response| ... }
115 116 117 118 119 |
# File 'flow/net/net.rb', line 115 [:get, :post, :put, :delete, :patch, :options, :head].each do |http_medhod| define_method(http_medhod) do |base_url, *, &callback| Request.send(http_medhod, base_url, .shift || {}, callback) end end |
+ (Boolean) reachable?(hostname = 'www.google.com', &block)
Track the reachability of a hostname
27 28 29 |
# File 'flow/net/net.rb', line 27 def reachable?(hostname = 'www.google.com', &block) Reachability.new(hostname, &block) end |
+ (Object) stub(base_url)
Stub an url to return the desired Response object
37 38 39 40 41 42 43 44 |
# File 'flow/net/net.rb', line 37 def stub(base_url) expectation = Expectation.all.find{ |e| e.base_url == base_url } if expectation.nil? expectation = Expectation.new(base_url) Expectation.all << expectation end expectation end |