Class: Isomorfeus::Puppetmaster::Server::Checker
- Inherits:
-
Object
- Object
- Isomorfeus::Puppetmaster::Server::Checker
- Defined in:
- lib/isomorfeus/puppetmaster/server/checker.rb
Instance Method Summary collapse
-
#initialize(host, port) ⇒ Checker
constructor
A new instance of Checker.
- #request(&block) ⇒ Object
- #ssl? ⇒ Boolean
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
18 19 20 |
# File 'lib/isomorfeus/puppetmaster/server/checker.rb', line 18 def ssl? @ssl end |