Class: GoogleSafeBrowsing::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/google_safe_browsing.rb

Overview

Handles the configuration values for the module

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

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_keyObject

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_verObject

Returns the value of attribute app_ver.



31
32
33
# File 'lib/google_safe_browsing.rb', line 31

def app_ver
  @app_ver
end

#clientObject

Returns the value of attribute client.



31
32
33
# File 'lib/google_safe_browsing.rb', line 31

def client
  @client
end

#client_keyObject

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_listsObject

Returns the value of attribute current_lists.



31
32
33
# File 'lib/google_safe_browsing.rb', line 31

def current_lists
  @current_lists
end

#hostObject

Returns the value of attribute host.



31
32
33
# File 'lib/google_safe_browsing.rb', line 31

def host
  @host
end

#mac_requiredObject

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_verObject

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_hostObject

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_keyObject

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

Returns:

  • (Boolean)


44
45
46
# File 'lib/google_safe_browsing.rb', line 44

def have_keys?
  @mac_required && @client_key.present? && @wrapped_key.present?
end