Module: WebPurify::Blacklist
- Included in:
- Client
- Defined in:
- lib/web_purify/methods/blacklist.rb
Overview
WebPurify::Blacklist
Handles all methods related to the WebPurify Blacklist
Instance Method Summary collapse
-
#add_to_blacklist(word, deep_search = 0) ⇒ Boolean
Add a word to the blacklist.
-
#get_blacklist ⇒ Array
Get the blacklist.
-
#remove_from_blacklist(word) ⇒ Boolean
Remove a word from the blacklist.
Instance Method Details
#add_to_blacklist(word, deep_search = 0) ⇒ Boolean
Add a word to the blacklist
13 14 15 16 17 18 19 20 21 |
# File 'lib/web_purify/methods/blacklist.rb', line 13 def add_to_blacklist(word, deep_search=0) params = { :method => WebPurify::Constants.methods[:add_to_blacklist], :word => word, :ds => deep_search } parsed = WebPurify::Request.query(@request_base, @query_base, params) return parsed[:success]=='1' end |
#get_blacklist ⇒ Array
Get the blacklist
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/web_purify/methods/blacklist.rb', line 41 def get_blacklist params = { :method => WebPurify::Constants.methods[:get_blacklist] } parsed = WebPurify::Request.query(@request_base, @query_base, params) if parsed[:word] return [] << parsed[:word] else return [] end end |
#remove_from_blacklist(word) ⇒ Boolean
Remove a word from the blacklist
28 29 30 31 32 33 34 35 |
# File 'lib/web_purify/methods/blacklist.rb', line 28 def remove_from_blacklist(word) params = { :method => WebPurify::Constants.methods[:remove_from_blacklist], :word => word } parsed = WebPurify::Request.query(@request_base, @query_base, params) return parsed[:success]=='1' end |