Class: Rundown::Processors::Sentiment

Inherits:
Rundown::Processor show all
Defined in:
lib/rundown/processors/sentiment.rb

Constant Summary

Constants inherited from Rundown::Processor

Rundown::Processor::PUNCTUATION

Instance Attribute Summary collapse

Attributes inherited from Rundown::Processor

#text, #words

Instance Method Summary collapse

Methods inherited from Rundown::Processor

#sentences

Constructor Details

#initialize(words, parser = SentimentParser) ⇒ Sentiment

Returns a new instance of Sentiment.



6
7
8
9
# File 'lib/rundown/processors/sentiment.rb', line 6

def initialize(words, parser=SentimentParser)
  @parser = parser
  super(words)
end

Instance Attribute Details

#parserObject

Returns the value of attribute parser.



4
5
6
# File 'lib/rundown/processors/sentiment.rb', line 4

def parser
  @parser
end

Instance Method Details

#processObject



11
12
13
# File 'lib/rundown/processors/sentiment.rb', line 11

def process
  parser.parse(words.join(' '))
end