Module: WebPurify::Constants
- Defined in:
- lib/web_purify/constants.rb
Overview
WebPurify::Constants
WebPurify::Constants holds all the static variables used to access the API.
Class Method Summary collapse
-
.format ⇒ String
The response format.
-
.image_endpoint ⇒ String
The endpoint for the image moderation service.
-
.methods ⇒ Hash
A hash for each API method.
-
.rest_path ⇒ String
Path appended to the endpoint URI.
-
.scheme(enterprise) ⇒ String
Returns either http or https depending on whether enterprise mode is selected.
-
.text_endpoints ⇒ Hash
The endpoints for the text moderation service.
Class Method Details
.format ⇒ String
The response format
39 40 41 |
# File 'lib/web_purify/constants.rb', line 39 def self.format return 'json' end |
.image_endpoint ⇒ String
The endpoint for the image moderation service
23 24 25 |
# File 'lib/web_purify/constants.rb', line 23 def self.image_endpoint return 'im-api1.webpurify.com' end |
.methods ⇒ Hash
A hash for each API method
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/web_purify/constants.rb', line 57 def self.methods return { :check => 'webpurify.live.check', :check_count => 'webpurify.live.checkcount', :replace => 'webpurify.live.replace', :return => 'webpurify.live.return', :add_to_blacklist => 'webpurify.live.addtoblacklist', :add_to_whitelist => 'webpurify.live.addtowhitelist', :remove_from_blacklist => 'webpurify.live.removefromblacklist', :remove_from_whitelist => 'webpurify.live.removefromwhitelist', :get_blacklist => 'webpurify.live.getblacklist', :get_whitelist => 'webpurify.live.getwhitelist', :imgcheck => 'webpurify.live.imgcheck', :imgstatus => 'webpurify.live.imgstatus', :imgaccount => 'webpurify.live.imgaccount' } end |
.rest_path ⇒ String
Path appended to the endpoint URI
31 32 33 |
# File 'lib/web_purify/constants.rb', line 31 def self.rest_path return '/services/rest/' end |
.scheme(enterprise) ⇒ String
Returns either http or https depending on whether enterprise mode
is selected.
49 50 51 |
# File 'lib/web_purify/constants.rb', line 49 def self.scheme(enterprise) return enterprise ? 'https' : 'http' end |
.text_endpoints ⇒ Hash
The endpoints for the text moderation service
11 12 13 14 15 16 17 |
# File 'lib/web_purify/constants.rb', line 11 def self.text_endpoints return { :us => 'api1.webpurify.com', :eu => 'api1-eu.webpurify.com', :ap => 'api1-ap.webpurify.com' } end |