Class: Isomorfeus::Puppetmaster::Server::Checker

Inherits:
Object
  • Object
show all
Defined in:
lib/isomorfeus/puppetmaster/server/checker.rb

Instance Method Summary collapse

Constructor Details

#initialize(host, port) ⇒ Checker

Returns a new instance of Checker.



5
6
7
8
# File 'lib/isomorfeus/puppetmaster/server/checker.rb', line 5

def initialize(host, port)
  @host, @port = host, port
  @ssl = false
end

Instance Method Details

#request(&block) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/isomorfeus/puppetmaster/server/checker.rb', line 10

def request(&block)
  ssl? ? https_request(&block) : http_request(&block)
rescue EOFError, Net::ReadTimeout, Errno::ECONNRESET
  res = https_request(&block)
  @ssl = true
  res
end

#ssl?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/isomorfeus/puppetmaster/server/checker.rb', line 18

def ssl?
  @ssl
end