Class: SyllabsApi::Modules::SentimentAnalysis::Response
- Inherits:
-
Object
- Object
- SyllabsApi::Modules::SentimentAnalysis::Response
- Defined in:
- lib/syllabs-api/modules/sentiment_analysis/response.rb
Instance Attribute Summary collapse
-
#evaluations ⇒ Object
readonly
Returns the value of attribute evaluations.
Instance Method Summary collapse
-
#initialize(json) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(json) ⇒ Response
Returns a new instance of Response.
8 9 10 11 12 13 14 15 |
# File 'lib/syllabs-api/modules/sentiment_analysis/response.rb', line 8 def initialize(json) @evaluations = [] json['response']['results']['evaluations'].each do |e| @evaluations << Evaluation.new(e['confidence'], e['object'], e['value'], e['eval']) end rescue Exception => e raise e end |
Instance Attribute Details
#evaluations ⇒ Object (readonly)
Returns the value of attribute evaluations.
7 8 9 |
# File 'lib/syllabs-api/modules/sentiment_analysis/response.rb', line 7 def evaluations @evaluations end |