Class: Viewpoint::EWS::Template::Message

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/ews/templates/message.rb

Direct Known Subclasses

ForwardItem, ReplyToItem

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Message

Returns a new instance of Message.



5
6
7
8
# File 'lib/ews/templates/message.rb', line 5

def initialize(opts = {})
  super opts.clone
  init_defaults!
end

Instance Method Details

#has_attachments?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/ews/templates/message.rb', line 16

def has_attachments?
  !(file_attachments.empty? && item_attachments.empty? && inline_attachments.empty?)
end

#to_ewsObject

Format this object for EWS backend consumption.



11
12
13
14
# File 'lib/ews/templates/message.rb', line 11

def to_ews
  ews_opts, msg = to_ews_basic
  ews_opts.merge({items: [{message: msg}]})
end