Class: ClarifaiRuby::Client
- Inherits:
-
Object
- Object
- ClarifaiRuby::Client
- Includes:
- HTTMultiParty
- Defined in:
- lib/clarifai_ruby/client.rb
Instance Attribute Summary collapse
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
- #get(url, opts = {}) ⇒ Object
-
#initialize ⇒ Client
constructor
A new instance of Client.
- #post(url, opts = {}) ⇒ Object
Constructor Details
#initialize ⇒ Client
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
#token ⇒ Object (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 |