Module: EmailProviderInfo
- Defined in:
- lib/email_provider_info.rb,
lib/email_provider_info/version.rb
Defined Under Namespace
Classes: Value
Constant Summary collapse
- VERSION =
"0.0.1"
Class Method Summary collapse
Class Method Details
.call(email) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/email_provider_info.rb', line 15 def self.call(email) host = email.to_s.downcase.split("@").last info = providers.find {|provider| provider[:hosts].include?(host) } Value.new(info[:name], info[:url], info[:hosts]) if info end |
.providers ⇒ Object
8 9 10 11 12 13 |
# File 'lib/email_provider_info.rb', line 8 def self.providers @providers ||= JSON.parse( File.read(File.join(__dir__, "../data/providers.json")), symbolize_names: true ) end |