Class: Textalytics::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty, Api::Base, Api::ClassificationEntity, Api::LanguageEntity, Api::SentimentEntity, Helpers::Request
Defined in:
lib/textalytics/client.rb

Constant Summary

Constants included from Helpers

Helpers::CLASSIFICATION, Helpers::LANGUAGE, Helpers::SENTIMENT, Helpers::TOPICS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Api::Base

#classification, #language, #sentiment, #topics

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



16
17
18
19
20
21
# File 'lib/textalytics/client.rb', line 16

def initialize(options = {})
  @sentiment_key = options[:sentiment] || ENV['SENTIMENT_KEY']
  @topics_key = options[:topics] || ENV['TOPICS_KEY']
  @classification_key = options[:classification] || ENV['CLASSIFICATION_KEY']
  @language_key = options[:language] || ENV['LANGUAGE_KEY']
end

Instance Attribute Details

#classification_keyObject (readonly)

Returns the value of attribute classification_key.



14
15
16
# File 'lib/textalytics/client.rb', line 14

def classification_key
  @classification_key
end

#language_keyObject (readonly)

Returns the value of attribute language_key.



14
15
16
# File 'lib/textalytics/client.rb', line 14

def language_key
  @language_key
end

#sentiment_keyObject (readonly)

Returns the value of attribute sentiment_key.



14
15
16
# File 'lib/textalytics/client.rb', line 14

def sentiment_key
  @sentiment_key
end

#topics_keyObject (readonly)

Returns the value of attribute topics_key.



14
15
16
# File 'lib/textalytics/client.rb', line 14

def topics_key
  @topics_key
end