Class: Auger::Http

Inherits:
Connection show all
Defined in:
lib/auger/plugin/http.rb

Instance Attribute Summary

Attributes inherited from Connection

#connection, #gateway, #options, #requests, #response, #roles

Instance Method Summary collapse

Methods inherited from Connection

#initialize, load, #method_missing, #timeout, #try_close, #try_open, #try_open_direct, #try_open_tunnel

Constructor Details

This class inherits a constructor from Auger::Connection

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Auger::Connection

Instance Method Details

#close(http) ⇒ Object



57
58
59
# File 'lib/auger/plugin/http.rb', line 57

def close(http)
  http.finish
end

#get(url, &block) ⇒ Object



39
40
41
# File 'lib/auger/plugin/http.rb', line 39

def get(url, &block)
  @requests << Auger::HttpGet.load(url, &block)
end

#open(host, options) ⇒ Object



47
48
49
50
51
52
53
54
55
# File 'lib/auger/plugin/http.rb', line 47

def open(host, options)
  http = Net::HTTP.new(host, options[:port])
  http.use_ssl = options[:ssl]
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE if options[:insecure]
  http.open_timeout = options[:timeout]
  http.read_timeout = options[:timeout]
  http.start
  http
end

#post(url, &block) ⇒ Object



43
44
45
# File 'lib/auger/plugin/http.rb', line 43

def post(url, &block)
  @requests << Auger::HttpPost.load(url, &block)
end