Class: Zm::Client::Message::Body

Inherits:
Object
  • Object
show all
Defined in:
lib/zm/client/message/message.rb

Overview

content fo an email

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#htmlObject

Returns the value of attribute html.



169
170
171
# File 'lib/zm/client/message/message.rb', line 169

def html
  @html
end

#textObject

Returns the value of attribute text.



169
170
171
# File 'lib/zm/client/message/message.rb', line 169

def text
  @text
end

Instance Method Details

#html_jsnsObject



175
176
177
# File 'lib/zm/client/message/message.rb', line 175

def html_jsns
  @html.nil? ? nil : { ct: 'text/html', content: { _content: @html } }
end

#text_jsnsObject



171
172
173
# File 'lib/zm/client/message/message.rb', line 171

def text_jsns
  @text.nil? ? nil : { ct: 'text/plain', content: { _content: @text } }
end

#to_jsnsObject



179
180
181
182
183
184
185
186
# File 'lib/zm/client/message/message.rb', line 179

def to_jsns
  [
    {
      ct: 'multipart/alternative',
      mp: [text_jsns, html_jsns].compact
    }
  ]
end