Class: ConstantContact::Components::TestSend
- Defined in:
- lib/constantcontact/components/email_marketing/test_send.rb
Instance Attribute Summary collapse
-
#email_addresses ⇒ Object
Returns the value of attribute email_addresses.
-
#format ⇒ Object
Returns the value of attribute format.
-
#personal_message ⇒ Object
Returns the value of attribute personal_message.
Class Method Summary collapse
-
.create(props) ⇒ TestSend
Factory method to create a TestSend object from an array.
Instance Method Summary collapse
-
#add_email(email_address) ⇒ Object
Add an email address to the set of addresses to send the test send too.
Methods inherited from Component
#to_hash, to_hash_value, #to_json
Instance Attribute Details
#email_addresses ⇒ Object
Returns the value of attribute email_addresses
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/test_send.rb', line 10 def email_addresses @email_addresses end |
#format ⇒ Object
Returns the value of attribute format
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/test_send.rb', line 10 def format @format end |
#personal_message ⇒ Object
Returns the value of attribute personal_message
10 11 12 |
# File 'lib/constantcontact/components/email_marketing/test_send.rb', line 10 def @personal_message end |
Class Method Details
.create(props) ⇒ TestSend
Factory method to create a TestSend object from an array
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/constantcontact/components/email_marketing/test_send.rb', line 16 def self.create(props) obj = TestSend.new if props props.each do |key, value| if key == 'email_addresses' if value obj.email_addresses = [] value.each do |email_address| obj.email_addresses << email_address end end else obj.send("#{key}=", value) if obj.respond_to? key end end end obj end |
Instance Method Details
#add_email(email_address) ⇒ Object
Add an email address to the set of addresses to send the test send too
38 39 40 41 |
# File 'lib/constantcontact/components/email_marketing/test_send.rb', line 38 def add_email(email_address) @email_addresses = [] if @email_addresses.nil? @email_addresses << email_address end |