Class: ConstantContact::Components::EmailAddress

Inherits:
Component
  • Object
show all
Defined in:
lib/constantcontact/components/contacts/email_address.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Component

#to_hash, to_hash_value, #to_json

Constructor Details

#initialize(email_address = nil) ⇒ EmailAddress

Class constructor

Parameters:

  • email_address (String) (defaults to: nil)


15
16
17
# File 'lib/constantcontact/components/contacts/email_address.rb', line 15

def initialize(email_address = nil)
  @email_address = email_address if email_address
end

Instance Attribute Details

#confirm_statusObject

Returns the value of attribute confirm_status



10
11
12
# File 'lib/constantcontact/components/contacts/email_address.rb', line 10

def confirm_status
  @confirm_status
end

#email_addressObject

Returns the value of attribute email_address



10
11
12
# File 'lib/constantcontact/components/contacts/email_address.rb', line 10

def email_address
  @email_address
end

#idObject

Returns the value of attribute id



10
11
12
# File 'lib/constantcontact/components/contacts/email_address.rb', line 10

def id
  @id
end

#opt_in_dateObject

Returns the value of attribute opt_in_date



10
11
12
# File 'lib/constantcontact/components/contacts/email_address.rb', line 10

def opt_in_date
  @opt_in_date
end

#opt_in_sourceObject

Returns the value of attribute opt_in_source



10
11
12
# File 'lib/constantcontact/components/contacts/email_address.rb', line 10

def opt_in_source
  @opt_in_source
end

#opt_out_dateObject

Returns the value of attribute opt_out_date



10
11
12
# File 'lib/constantcontact/components/contacts/email_address.rb', line 10

def opt_out_date
  @opt_out_date
end

#statusObject

Returns the value of attribute status



10
11
12
# File 'lib/constantcontact/components/contacts/email_address.rb', line 10

def status
  @status
end

Class Method Details

.create(props) ⇒ EmailAddress

Factory method to create an EmailAddress object from a json string

Parameters:

  • props (Hash)
    • properties to create object from

Returns:



22
23
24
25
26
27
28
29
30
# File 'lib/constantcontact/components/contacts/email_address.rb', line 22

def self.create(props)
  obj = EmailAddress.new
  if props
    props.each do |key, value|
      obj.send("#{key}=", value) if obj.respond_to? key
    end
  end
  obj
end