Class: WebPurify::Client
- Inherits:
-
Object
- Object
- WebPurify::Client
- Defined in:
- lib/web_purify/client.rb
Overview
WebPurify::Client
The WebPurify::Client class maintains state of the request parameters like api_key, endpoint, etc., and provides easy methods for accessing WebPurify
Instance Method Summary collapse
-
#initialize(options) ⇒ Client
constructor
Initialize the class.
Methods included from Whitelist
#add_to_whitelist, #get_whitelist, #remove_from_whitelist
Methods included from Blacklist
#add_to_blacklist, #get_blacklist, #remove_from_blacklist
Methods included from Filters
#check, #check_count, #replace, #return
Constructor Details
#initialize(options) ⇒ Client
Initialize the class
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/web_purify/client.rb', line 17 def initialize() if .is_a? String @api_key = @endpoint = :us @enterprise = false elsif .is_a? Hash @api_key = [:api_key] @endpoint = [:endpoint] || :us @enterprise = [:enterprise] || false end @request_base = { :host => WebPurify::Constants.endpoints[@endpoint], :path => WebPurify::Constants.rest_path, :scheme => WebPurify::Constants.scheme(@enterprise) } @query_base = { :api_key => @api_key, :format => WebPurify::Constants.format } end |