Class: Kestrel::Client::Json

Inherits:
Proxy
  • Object
show all
Defined in:
lib/kestrel/client/json.rb

Instance Attribute Summary

Attributes inherited from Proxy

#client

Instance Method Summary collapse

Methods inherited from Proxy

#initialize, #method_missing

Constructor Details

This class inherits a constructor from Kestrel::Client::Proxy

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Kestrel::Client::Proxy

Instance Method Details

#get(*args) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/kestrel/client/json.rb', line 6

def get(*args)
  response = client.get(*args)
  if response.is_a?(String)
    HashWithIndifferentAccess.new(JSON.parse(response)) rescue response
  else
    response
  end
end