Class: Cleo::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/cleo/base_server.rb

Direct Known Subclasses

ConnectionServer, ElementServer, Service

Class Method Summary collapse

Class Method Details

.async?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/cleo/base_server.rb', line 11

def self.async?
  async == true
end

.auto_flush?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/cleo/base_server.rb', line 15

def self.auto_flush?
  auto_flush == true
end

.good_response_code?(response) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
22
23
24
25
26
# File 'lib/cleo/base_server.rb', line 19

def self.good_response_code?(response)
  case response
  when Net::HTTPOK
    true   # success response
  when Net::HTTPClientError, Net::HTTPInternalServerError
    false  # non-success response
  end
end