Class: Proxy::Omaha::OmahaProtocol::Response

Inherits:
Object
  • Object
show all
Includes:
Log
Defined in:
lib/smart_proxy_omaha/omaha_protocol/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Response

Returns a new instance of Response.



9
10
11
12
13
14
# File 'lib/smart_proxy_omaha/omaha_protocol/response.rb', line 9

def initialize(options = {})
  @appid = options.fetch(:appid)
  @base_url = options.fetch(:base_url)
  @host = URI.parse(base_url).host
  @status = options.fetch(:status, 'ok')
end

Instance Attribute Details

#appidObject (readonly)

Returns the value of attribute appid.



7
8
9
# File 'lib/smart_proxy_omaha/omaha_protocol/response.rb', line 7

def appid
  @appid
end

#base_urlObject (readonly)

Returns the value of attribute base_url.



7
8
9
# File 'lib/smart_proxy_omaha/omaha_protocol/response.rb', line 7

def base_url
  @base_url
end

#hostObject (readonly)

Returns the value of attribute host.



7
8
9
# File 'lib/smart_proxy_omaha/omaha_protocol/response.rb', line 7

def host
  @host
end

#statusObject (readonly)

Returns the value of attribute status.



7
8
9
# File 'lib/smart_proxy_omaha/omaha_protocol/response.rb', line 7

def status
  @status
end

Instance Method Details

#http_statusObject



20
21
22
# File 'lib/smart_proxy_omaha/omaha_protocol/response.rb', line 20

def http_status
  200
end

#to_xmlObject



16
17
18
# File 'lib/smart_proxy_omaha/omaha_protocol/response.rb', line 16

def to_xml
  xml.to_xml
end