Class: GoogleSafeBrowsing::Config
- Inherits:
-
Object
- Object
- GoogleSafeBrowsing::Config
- Defined in:
- lib/google_safe_browsing.rb
Overview
Handles the configuration values for the module
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#app_ver ⇒ Object
Returns the value of attribute app_ver.
-
#client ⇒ Object
Returns the value of attribute client.
-
#client_key ⇒ Object
Returns the value of attribute client_key.
-
#current_lists ⇒ Object
Returns the value of attribute current_lists.
-
#host ⇒ Object
Returns the value of attribute host.
-
#mac_required ⇒ Object
Returns the value of attribute mac_required.
-
#p_ver ⇒ Object
Returns the value of attribute p_ver.
-
#rekey_host ⇒ Object
Returns the value of attribute rekey_host.
-
#wrapped_key ⇒ Object
Returns the value of attribute wrapped_key.
Instance Method Summary collapse
- #have_keys? ⇒ Boolean
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
34 35 36 37 38 39 40 41 42 |
# File 'lib/google_safe_browsing.rb', line 34 def initialize @client = 'api' @app_ver = VERSION @p_ver = '2.2' @host = 'http://safebrowsing.clients.google.com/safebrowsing' @rekey_host = 'https://sb-ssl.google.com/safebrowsing' @current_lists = ['googpub-phish-shavar', 'goog-malware-shavar'] @mac_required = true end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
31 32 33 |
# File 'lib/google_safe_browsing.rb', line 31 def api_key @api_key end |
#app_ver ⇒ Object
Returns the value of attribute app_ver.
31 32 33 |
# File 'lib/google_safe_browsing.rb', line 31 def app_ver @app_ver end |
#client ⇒ Object
Returns the value of attribute client.
31 32 33 |
# File 'lib/google_safe_browsing.rb', line 31 def client @client end |
#client_key ⇒ Object
Returns the value of attribute client_key.
31 32 33 |
# File 'lib/google_safe_browsing.rb', line 31 def client_key @client_key end |
#current_lists ⇒ Object
Returns the value of attribute current_lists.
31 32 33 |
# File 'lib/google_safe_browsing.rb', line 31 def current_lists @current_lists end |
#host ⇒ Object
Returns the value of attribute host.
31 32 33 |
# File 'lib/google_safe_browsing.rb', line 31 def host @host end |
#mac_required ⇒ Object
Returns the value of attribute mac_required.
31 32 33 |
# File 'lib/google_safe_browsing.rb', line 31 def mac_required @mac_required end |
#p_ver ⇒ Object
Returns the value of attribute p_ver.
31 32 33 |
# File 'lib/google_safe_browsing.rb', line 31 def p_ver @p_ver end |
#rekey_host ⇒ Object
Returns the value of attribute rekey_host.
31 32 33 |
# File 'lib/google_safe_browsing.rb', line 31 def rekey_host @rekey_host end |
#wrapped_key ⇒ Object
Returns the value of attribute wrapped_key.
31 32 33 |
# File 'lib/google_safe_browsing.rb', line 31 def wrapped_key @wrapped_key end |
Instance Method Details
#have_keys? ⇒ Boolean
44 45 46 |
# File 'lib/google_safe_browsing.rb', line 44 def have_keys? @mac_required && @client_key.present? && @wrapped_key.present? end |