class WebmailProvider
Attributes
name[R]
url[R]
Public Class Methods
for(email_address)
click to toggle source
# File lib/webmail_provider.rb, line 12 def self.for(email_address) domain = email_address && email_address.split('@').last.to_s.strip list[domain] end
list()
click to toggle source
# File lib/webmail_provider.rb, line 17 def self.list @list ||= CSV.foreach(File.join(__dir__, 'providers.csv')) .each_with_object({}) do |(domain, *attributes), hash| hash[domain] = new(*attributes) end end
new(name, url)
click to toggle source
# File lib/webmail_provider.rb, line 7 def initialize(name, url) @name = name @url = URI("https://#{url}") end