Class: SyllabsApi::Modules::SentimentAnalysis::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/syllabs-api/modules/sentiment_analysis/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#evaluationsObject (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