Class: Mailmate::Attributes::AddressValue Private

Inherits:
Struct
  • Object
show all
Defined in:
lib/mailmate/attributes.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

AddressValue wraps Mail::Address so ‘.step` knows what to extract.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#addrObject

Returns the value of attribute addr

Returns:

  • (Object)

    the current value of addr



155
156
157
# File 'lib/mailmate/attributes.rb', line 155

def addr
  @addr
end

Instance Method Details

#addressObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



168
169
170
# File 'lib/mailmate/attributes.rb', line 168

def address
  addr.address
end

#nameObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



164
165
166
# File 'lib/mailmate/attributes.rb', line 164

def name
  addr.display_name
end

#to_sObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



156
157
158
159
160
161
162
# File 'lib/mailmate/attributes.rb', line 156

def to_s
  if addr.display_name && !addr.display_name.empty?
    "#{addr.display_name} <#{addr.address}>"
  else
    addr.address.to_s
  end
end