Class: AWS::SimpleEmailService::Identity

Inherits:
Core::Resource show all
Defined in:
lib/aws/simple_email_service/identity.rb

Instance Attribute Summary collapse

Attributes included from Core::Model

#config

Instance Method Summary collapse

Methods inherited from Core::Resource

attribute_providers, attribute_providers_for, attributes, #attributes_from_response, define_attribute_type, #eql?, #inspect, new_from

Methods included from Core::Cacheable

included, #retrieve_attribute

Methods included from Core::Model

#client, #config_prefix, #inspect

Constructor Details

#initialize(email_address_or_domain, options = {}) ⇒ Identity

Returns a new instance of Identity.



24
25
26
27
# File 'lib/aws/simple_email_service/identity.rb', line 24

def initialize email_address_or_domain, options = {}
  @identity = email_address_or_domain
  super
end

Instance Attribute Details

#identityString (readonly)

Returns the email address or domain name for this identity.

Returns:

  • (String)

    Returns the email address or domain name for this identity.



31
32
33
# File 'lib/aws/simple_email_service/identity.rb', line 31

def identity
  @identity
end

#verification_statusString (readonly)

Returns the current value of verification_status.

Returns:

  • (String)

    the current value of verification_status



21
22
23
# File 'lib/aws/simple_email_service/identity.rb', line 21

def verification_status
  @verification_status
end

#verification_tokenString? (readonly)

Returns the current value of verification_token.

Returns:

  • (String, nil)

    the current value of verification_token



21
22
23
# File 'lib/aws/simple_email_service/identity.rb', line 21

def verification_token
  @verification_token
end

Instance Method Details

#deletenil

Deletes the current identity.

Returns:

  • (nil)


67
68
69
70
# File 'lib/aws/simple_email_service/identity.rb', line 67

def delete
  client.delete_identity(:identity => identity)  
  nil
end

#domain?Boolean

Returns true if this AWS::SimpleEmailService::Identity represents a domain.

Returns:



49
50
51
# File 'lib/aws/simple_email_service/identity.rb', line 49

def domain?
  !email_address?
end

#email_address?Boolean

Returns true if this AWS::SimpleEmailService::Identity represents an email address.

Returns:



43
44
45
# File 'lib/aws/simple_email_service/identity.rb', line 43

def email_address?
  identity =~ /@/ ? true : false
end

#exists?Boolean

Returns true if the identity exists.

Returns:

  • (Boolean)

    Returns true if the identity exists.



73
74
75
# File 'lib/aws/simple_email_service/identity.rb', line 73

def exists?
  !!get_resource[:verification_attributes][identity]
end

#pending?Boolean

Returns true if verification for this email address/domain is still pending.

Returns:

  • (Boolean)

    Returns true if verification for this email address/domain is still pending.



61
62
63
# File 'lib/aws/simple_email_service/identity.rb', line 61

def pending?
  verification_status == 'Pending'
end

#verified?Boolean

Returns true if this email address/domain has been verified.

Returns:

  • (Boolean)

    Returns true if this email address/domain has been verified.



55
56
57
# File 'lib/aws/simple_email_service/identity.rb', line 55

def verified?
  verification_status == 'Success'
end