Module: WebPurify::Whitelist
- Included in:
- Client
- Defined in:
- lib/web_purify/methods/whitelist.rb
Overview
WebPurify::Whitelist
Handles all methods related to the WebPurify whitelist
Instance Method Summary collapse
-
#add_to_whitelist(word) ⇒ Boolean
Add a word to the whitelist.
-
#get_whitelist ⇒ Array
Get the whitelist.
-
#remove_from_whitelist(word) ⇒ Boolean
Remove a word from the whitelist.
Instance Method Details
#add_to_whitelist(word) ⇒ Boolean
Add a word to the whitelist
12 13 14 15 16 17 18 19 |
# File 'lib/web_purify/methods/whitelist.rb', line 12 def add_to_whitelist(word) params = { :method => WebPurify::Constants.methods[:add_to_whitelist], :word => word } parsed = WebPurify::Request.query(@request_base, @query_base, params) return parsed[:success]=='1' end |
#get_whitelist ⇒ Array
Get the whitelist
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/web_purify/methods/whitelist.rb', line 39 def get_whitelist params = { :method => WebPurify::Constants.methods[:get_whitelist] } parsed = WebPurify::Request.query(@request_base, @query_base, params) if parsed[:word] return [] << parsed[:word] else return [] end end |
#remove_from_whitelist(word) ⇒ Boolean
Remove a word from the whitelist
26 27 28 29 30 31 32 33 |
# File 'lib/web_purify/methods/whitelist.rb', line 26 def remove_from_whitelist(word) params = { :method => WebPurify::Constants.methods[:remove_from_whitelist], :word => word } parsed = WebPurify::Request.query(@request_base, @query_base, params) return parsed[:success]=='1' end |