Class: EmailGraph::GmailFetcher::Address

Inherits:
Struct
  • Object
show all
Defined in:
lib/email_graph/gmail_fetcher.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**kwargs) ⇒ Address

Returns a new instance of Address.



88
89
90
# File 'lib/email_graph/gmail_fetcher.rb', line 88

def initialize(**kwargs)
  kwargs.each{ |k, v| self[k] = v }
end

Instance Attribute Details

#emailObject

Returns the value of attribute email

Returns:

  • (Object)

    the current value of email



86
87
88
# File 'lib/email_graph/gmail_fetcher.rb', line 86

def email
  @email
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



86
87
88
# File 'lib/email_graph/gmail_fetcher.rb', line 86

def name
  @name
end

Class Method Details

.from_net_imap_address(a) ⇒ Address

Parameters:

  • a (Net::IMAP::Address)

Returns:



94
95
96
97
# File 'lib/email_graph/gmail_fetcher.rb', line 94

def self.from_net_imap_address(a)
  new( name:  a.name, 
       email: "#{a.mailbox}@#{a.host}" )
end