Class: Bubble::KeywordsMaker::Keywords

Inherits:
Object
  • Object
show all
Defined in:
lib/bubble/keywords_maker/keywords.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ Keywords

Returns a new instance of Keywords.



6
7
8
# File 'lib/bubble/keywords_maker/keywords.rb', line 6

def initialize(text)
  self.original_text = text
end

Instance Attribute Details

#original_textObject

Returns the value of attribute original_text.



4
5
6
# File 'lib/bubble/keywords_maker/keywords.rb', line 4

def original_text
  @original_text
end

Instance Method Details

#keywords(limit = 10) ⇒ Object



10
11
12
# File 'lib/bubble/keywords_maker/keywords.rb', line 10

def keywords(limit = 10)
  Counter.new(original_text).keywords[0...limit].sort
end