Class: ChefAnalytics::ServerAPI
- Inherits:
-
Chef::HTTP
- Object
- Chef::HTTP
- ChefAnalytics::ServerAPI
- Defined in:
- lib/chef-analytics/server_api.rb
Instance Attribute Summary collapse
-
#authentication_token ⇒ Object
Returns the value of attribute authentication_token.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url, token, options = {}) ⇒ ServerAPI
constructor
A new instance of ServerAPI.
Constructor Details
#initialize(url, token, options = {}) ⇒ ServerAPI
Returns a new instance of ServerAPI.
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/chef-analytics/server_api.rb', line 26 def initialize(url, token, = {}) = .dup [:authentication_token] = token super(url, ) @authenticator = ChefAnalytics::HTTP::TokenAuthenticator.new() @request_id = RemoteRequestID.new() @middlewares << Chef::HTTP::JSONOutput.new() @middlewares << @authenticator @middlewares << @request_id end |
Instance Attribute Details
#authentication_token ⇒ Object
Returns the value of attribute authentication_token.
24 25 26 |
# File 'lib/chef-analytics/server_api.rb', line 24 def authentication_token @authentication_token end |
#url ⇒ Object
Returns the value of attribute url.
24 25 26 |
# File 'lib/chef-analytics/server_api.rb', line 24 def url @url end |