Class: AwsDetectSentiment::Assign

Inherits:
Object
  • Object
show all
Defined in:
lib/aws_detect_sentiment/assign.rb

Instance Method Summary collapse

Constructor Details

#initialize(scope:, text_field:, api_client: AwsDetectSentiment::AwsComprehendClient.new) ⇒ Assign

Returns a new instance of Assign.

Parameters:

  • (defaults to: AwsDetectSentiment::AwsComprehendClient.new)


6
7
8
9
10
# File 'lib/aws_detect_sentiment/assign.rb', line 6

def initialize(scope:, text_field:, api_client: AwsDetectSentiment::AwsComprehendClient.new)
  self.scope = scope
  self.text_field = text_field
  self.api_client = api_client
end

Instance Method Details

#performObject



12
13
14
15
16
# File 'lib/aws_detect_sentiment/assign.rb', line 12

def perform
  records.each_with_index do |record, index|
    yield(record, sentiments[index])
  end
end