Method: Bluepill::ProcessConditions::Http#initialize
- Defined in:
- lib/bluepill/process_conditions/http.rb
#initialize(options = {}) ⇒ Http
Returns a new instance of Http.
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/bluepill/process_conditions/http.rb', line 8 def initialize( = {}) @uri = URI.parse([:url]) @kind = case [:kind] when Fixnum then Net::HTTPResponse::CODE_TO_OBJ[[:kind].to_s] when String, Symbol then Net.const_get("HTTP#{[:kind].to_s.camelize}") else Net::HTTPSuccess end @pattern = [:pattern] || nil @open_timeout = ([:open_timeout] || [:timeout] || 5).to_i @read_timeout = ([:read_timeout] || [:timeout] || 5).to_i end |