Class: Proxy::Omaha::OmahaProtocol::Response
- Inherits:
-
Object
- Object
- Proxy::Omaha::OmahaProtocol::Response
- Includes:
- Log
- Defined in:
- lib/smart_proxy_omaha/omaha_protocol/response.rb
Direct Known Subclasses
Errorinternalresponse, Eventacknowledgeresponse, Noupdateresponse, Pingresponse, Updateresponse
Instance Attribute Summary collapse
-
#appid ⇒ Object
readonly
Returns the value of attribute appid.
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #http_status ⇒ Object
-
#initialize(options = {}) ⇒ Response
constructor
A new instance of Response.
- #to_xml ⇒ Object
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( = {}) @appid = .fetch(:appid) @base_url = .fetch(:base_url) @host = URI.parse(base_url).host @status = .fetch(:status, 'ok') end |
Instance Attribute Details
#appid ⇒ Object (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_url ⇒ Object (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 |
#host ⇒ Object (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 |
#status ⇒ Object (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_status ⇒ Object
20 21 22 |
# File 'lib/smart_proxy_omaha/omaha_protocol/response.rb', line 20 def http_status 200 end |
#to_xml ⇒ Object
16 17 18 |
# File 'lib/smart_proxy_omaha/omaha_protocol/response.rb', line 16 def to_xml xml.to_xml end |