class Google::SafeBrowsingList

Public Class Methods

list_by_name(name) click to toggle source
# File lib/rails/generators/google/model/templates/google/safe_browsing_list.rb, line 27
def list_by_name name
  if valid_list?(name.to_s)
    if malware_list.name == name.to_s
      malware_list
    elsif phishing_list.name == name.to_s
      phishing_list
    end
  else
    nil
  end
end
malware_list() click to toggle source
# File lib/rails/generators/google/model/templates/google/safe_browsing_list.rb, line 19
def malware_list
  @malware_list_obj ||= find_by_name MalwareList
end
phishing_list() click to toggle source
# File lib/rails/generators/google/model/templates/google/safe_browsing_list.rb, line 23
def phishing_list
  @phishing_list_obj ||= find_by_name PhishList
end
valid_list?(list_name) click to toggle source
# File lib/rails/generators/google/model/templates/google/safe_browsing_list.rb, line 15
def valid_list? list_name
  [MalwareList, PhishList].include?(list_name.to_s)
end