Class: Bubble::KeywordsMaker::Blacklist

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/bubble/keywords_maker/blacklist.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBlacklist

Returns a new instance of Blacklist.



31
32
33
34
# File 'lib/bubble/keywords_maker/blacklist.rb', line 31

def initialize
  self.words = []
  self.locate = Bubble::KeywordsMaker::Default::PtBr
end

Instance Attribute Details

#locateObject

Returns the value of attribute locate.



8
9
10
# File 'lib/bubble/keywords_maker/blacklist.rb', line 8

def locate
  @locate
end

#wordsObject

Returns the value of attribute words.



8
9
10
# File 'lib/bubble/keywords_maker/blacklist.rb', line 8

def words
  @words
end

Class Method Details

.locate=(locate) ⇒ Object



27
28
29
# File 'lib/bubble/keywords_maker/blacklist.rb', line 27

def self.locate=(locate)
  instance.locate = locate
end

.regexpObject



23
24
25
# File 'lib/bubble/keywords_maker/blacklist.rb', line 23

def self.regexp
  %r(^(#{words.join('|')})$)
end

.wordsObject



14
15
16
17
18
19
20
21
# File 'lib/bubble/keywords_maker/blacklist.rb', line 14

def self.words
  black = %w([a-z] [0-9]+)

  black << Bubble::KeywordsMaker::Blacklist.instance.locate::Blacklist
  
  black << Bubble::KeywordsMaker::Blacklist.instance.words
  black.flatten
end

.words=(array) ⇒ Object



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

def self.words=(array)
  instance.words = array
end