Class: Textalytics::Client
- Inherits:
-
Object
- Object
- Textalytics::Client
- 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
-
#classification_key ⇒ Object
readonly
Returns the value of attribute classification_key.
-
#language_key ⇒ Object
readonly
Returns the value of attribute language_key.
-
#sentiment_key ⇒ Object
readonly
Returns the value of attribute sentiment_key.
-
#topics_key ⇒ Object
readonly
Returns the value of attribute topics_key.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
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( = {}) @sentiment_key = [:sentiment] || ENV['SENTIMENT_KEY'] @topics_key = [:topics] || ENV['TOPICS_KEY'] @classification_key = [:classification] || ENV['CLASSIFICATION_KEY'] @language_key = [:language] || ENV['LANGUAGE_KEY'] end |
Instance Attribute Details
#classification_key ⇒ Object (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_key ⇒ Object (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_key ⇒ Object (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_key ⇒ Object (readonly)
Returns the value of attribute topics_key.
14 15 16 |
# File 'lib/textalytics/client.rb', line 14 def topics_key @topics_key end |