Class: Lono::Api::Client
- Inherits:
-
Object
- Object
- Lono::Api::Client
- Extended by:
- Memoist
- Defined in:
- lib/lono/api/client.rb
Instance Method Summary collapse
Methods included from Repos
Methods included from Verify
Instance Method Details
#http ⇒ Object
7 8 9 |
# File 'lib/lono/api/client.rb', line 7 def http Proxy.new end |
#load_json(res) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/lono/api/client.rb', line 12 def load_json(res) if res.code == "200" data = JSON.load(res.body) case data when Array data.map(&:deep_symbolize_keys) when Hash data.deep_symbolize_keys end else if ENV['LONO_DEBUG_API'] puts "Error: Non-successful http response status code: #{res.code}" puts "headers: #{res.each_header.to_h.inspect}" end nil end end |