Method: KlaviyoAPI::EmailContent#initialize
- Defined in:
- lib/klaviyo-api-sdk/models/email_content.rb
#initialize(attributes = {}) ⇒ EmailContent
Initializes the object
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/klaviyo-api-sdk/models/email_content.rb', line 85 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::EmailContent` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::EmailContent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'subject') self.subject = attributes[:'subject'] end if attributes.key?(:'preview_text') self.preview_text = attributes[:'preview_text'] end if attributes.key?(:'from_email') self.from_email = attributes[:'from_email'] end if attributes.key?(:'from_label') self.from_label = attributes[:'from_label'] end if attributes.key?(:'reply_to_email') self.reply_to_email = attributes[:'reply_to_email'] end if attributes.key?(:'cc_email') self.cc_email = attributes[:'cc_email'] end if attributes.key?(:'bcc_email') self.bcc_email = attributes[:'bcc_email'] end end |