Module: ReservedWords

Defined in:
lib/reserved_words.rb,
lib/reserved_words/version.rb

Constant Summary collapse

DEFAULT_WORDS =
%w(admin api image rss www cdn)
VERSION =
'0.1.4'

Class Method Summary collapse

Class Method Details

.add(word) ⇒ Object



14
15
16
# File 'lib/reserved_words.rb', line 14

def self.add(word)
  Array.wrap(word).each { |w| @reserved_words.add(w) }
end

.clear!Object



22
23
24
# File 'lib/reserved_words.rb', line 22

def self.clear!
  @reserved_words = SortedSet.new DEFAULT_WORDS.dup
end

.listObject



10
11
12
# File 'lib/reserved_words.rb', line 10

def self.list
  @reserved_words.to_a
end

.remove(word) ⇒ Object



18
19
20
# File 'lib/reserved_words.rb', line 18

def self.remove(word)
  @reserved_words.delete(word)
end