Class: Viewpoint::EWS::Types::Attachment

Inherits:
Object
  • Object
show all
Includes:
Viewpoint::EWS, Viewpoint::EWS::Types, Item
Defined in:
lib/ews/types/attachment.rb

Overview

A generic Attachment. This class should not be instantiated directly. You should use one of the subclasses like FileAttachment or ItemAttachment.

Direct Known Subclasses

FileAttachment, ItemAttachment

Constant Summary collapse

ATTACH_KEY_PATHS =
{
  :id   => [:attachment_id, :attribs, :id],
  :parent_item_id  => [:attachment_id, :attribs, :root_item_id],
  :parent_change_key  => [:attachment_id, :attribs, :root_item_change_key],
  :name => [:name, :text],
  :content_type => [:content_type, :text],
  :content_id => [:content_id],
  :size => [:size, :text],
  :last_modified_time => [:last_modified_time, :text],
  :is_inline? => [:is_inline, :text],
}
ATTACH_KEY_TYPES =
{
  is_inline?:   ->(str){str.downcase == 'true'},
  last_modified_type: ->(str){DateTime.parse(str)},
  size: ->(str){str.to_i},
  content_id: :fix_content_id,
}
ATTACH_KEY_ALIAS =
{ }

Constants included from Item

Item::ITEM_KEY_ALIAS, Item::ITEM_KEY_PATHS, Item::ITEM_KEY_TYPES

Constants included from ItemFieldUriMap

ItemFieldUriMap::FIELD_URIS

Constants included from Viewpoint::EWS::Types

KEY_ALIAS, KEY_PATHS, KEY_TYPES, OOF_KEY_ALIAS, OOF_KEY_PATHS, OOF_KEY_TYPES

Constants included from StringUtils

StringUtils::DURATION_RE

Constants included from Viewpoint::EWS

ConnectingSID

Instance Attribute Summary

Attributes included from Item

#ews_item, #parent

Attributes included from Viewpoint::EWS::Types

#ews_item

Attributes included from Viewpoint::EWS

#logger

Instance Method Summary collapse

Methods included from Item

#add_file_attachment, #add_inline_attachment, #add_item_attachment, #copy, #default_body_type=, #delete!, #forward, #get_all_properties!, included, #mark_read!, #mark_unread!, #move!, #recycle!, #reply_to, #reply_to_all, #submit!, #submit_attachments!

Methods included from Viewpoint::EWS::Types

#auto_deepen?, #deepen!, #ews_methods, #freeze!, #frozen?, #mark_deep!, #method_missing, #methods, #respond_to?, #shallow?, #to_s, #unfreeze!

Methods included from StringUtils

included

Methods included from Viewpoint::EWS

#remove_impersonation, root_logger, #set_impersonation

Constructor Details

#initialize(item, attachment) ⇒ Attachment

Returns a new instance of Attachment.

Parameters:

  • attachment (Hash)

    The attachment ews_item


49
50
51
52
# File 'lib/ews/types/attachment.rb', line 49

def initialize(item, attachment)
  @item = item
  super(item.ews, attachment)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Viewpoint::EWS::Types