Class: TargetIO::HTTP::SimpleJSON
- Inherits:
-
Object
- Object
- TargetIO::HTTP::SimpleJSON
- Defined in:
- lib/chef/target_io/http.rb
Instance Method Summary collapse
- #get(path, headers = {}) ⇒ Object
-
#initialize(url, http_client_opts = {}) ⇒ SimpleJSON
constructor
A new instance of SimpleJSON.
Constructor Details
#initialize(url, http_client_opts = {}) ⇒ SimpleJSON
Returns a new instance of SimpleJSON.
24 25 26 |
# File 'lib/chef/target_io/http.rb', line 24 def initialize(url, http_client_opts = {}) @http_class = TargetIO::HTTP.new(url, http_client_opts) end |
Instance Method Details
#get(path, headers = {}) ⇒ Object
28 29 30 31 32 |
# File 'lib/chef/target_io/http.rb', line 28 def get(path, headers = {}) response = @http_class.get(path, headers) Chef::JSONCompat.from_json(response) end |