Class: AwsDetectSentiment::Assign
- Inherits:
-
Object
- Object
- AwsDetectSentiment::Assign
- Defined in:
- lib/aws_detect_sentiment/assign.rb
Instance Method Summary collapse
-
#initialize(scope:, text_field:, api_client: AwsDetectSentiment::AwsComprehendClient.new) ⇒ Assign
constructor
A new instance of Assign.
- #perform ⇒ Object
Constructor Details
#initialize(scope:, text_field:, api_client: AwsDetectSentiment::AwsComprehendClient.new) ⇒ Assign
Returns a new instance of Assign.
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
#perform ⇒ Object
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 |