Class: ClarifaiRuby::Client

Inherits:
Object
  • Object
show all
Includes:
HTTMultiParty
Defined in:
lib/clarifai_ruby/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeClient

Returns a new instance of Client.



11
12
13
14
15
# File 'lib/clarifai_ruby/client.rb', line 11

def initialize
  @token = Token.new.token
  self.class.base_uri ClarifaiRuby.configuration.api_url
  self.class.headers auth_header
end

Instance Attribute Details

#tokenObject (readonly)

Returns the value of attribute token.



9
10
11
# File 'lib/clarifai_ruby/client.rb', line 9

def token
  @token
end

Instance Method Details

#get(url, opts = {}) ⇒ Object



17
18
19
20
# File 'lib/clarifai_ruby/client.rb', line 17

def get(url, opts={})
  response = self.class.get(url, query: opts)
  #TODO handle raising any errors here
end

#post(url, opts = {}) ⇒ Object



22
23
24
25
# File 'lib/clarifai_ruby/client.rb', line 22

def post(url, opts={})
  response = self.class.post(url, query: opts)
  #TODO handle raising any errors here
end