Module: Viewpoint::EWS::Types

Includes:
StringUtils
Included in:
Attachment, CalendarFolder, CalendarItem, Contact, ContactsFolder, DistributionList, Event, ExportItemsResponseMessage, Folder, GenericFolder, Item, MailboxUser, MeetingCancellation, MeetingMessage, MeetingRequest, MeetingResponse, Message, OutOfOffice, SearchFolder, StatusEvent, Task, TasksFolder
Defined in:
lib/ews/types/event.rb,
lib/ews/types.rb,
lib/ews/types/item.rb,
lib/ews/types/task.rb,
lib/ews/types/folder.rb,
lib/ews/types/contact.rb,
lib/ews/types/message.rb,
lib/ews/types/attendee.rb,
lib/ews/types/attachment.rb,
lib/ews/types/moved_event.rb,
lib/ews/types/copied_event.rb,
lib/ews/types/mailbox_user.rb,
lib/ews/types/status_event.rb,
lib/ews/types/tasks_folder.rb,
lib/ews/types/calendar_item.rb,
lib/ews/types/created_event.rb,
lib/ews/types/deleted_event.rb,
lib/ews/types/out_of_office.rb,
lib/ews/types/search_folder.rb,
lib/ews/types/generic_folder.rb,
lib/ews/types/modified_event.rb,
lib/ews/types/new_mail_event.rb,
lib/ews/types/calendar_folder.rb,
lib/ews/types/contacts_folder.rb,
lib/ews/types/file_attachment.rb,
lib/ews/types/item_attachment.rb,
lib/ews/types/meeting_message.rb,
lib/ews/types/meeting_request.rb,
lib/ews/types/meeting_response.rb,
lib/ews/types/distribution_list.rb,
lib/ews/types/meeting_cancellation.rb,
lib/ews/types/free_busy_changed_event.rb,
lib/ews/types/export_items_response_message.rb

Overview

This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.

Copyright © 2011 Dan Wanek <[email protected]>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Defined Under Namespace

Modules: GenericFolder, Item Classes: Attachment, Attendee, CalendarFolder, CalendarItem, Contact, ContactsFolder, CopiedEvent, CreatedEvent, DeletedEvent, DistributionList, Event, ExportItemsResponseMessage, FileAttachment, Folder, FreeBusyChangedEvent, ItemAttachment, MailboxUser, MeetingCancellation, MeetingMessage, MeetingRequest, MeetingResponse, Message, ModifiedEvent, MovedEvent, NewMailEvent, OutOfOffice, SearchFolder, StatusEvent, Task, TasksFolder

Constant Summary collapse

KEY_PATHS =
{
  extended_properties: [:extended_property],
}
KEY_TYPES =
{
  extended_properties: :build_extended_properties,
}
KEY_ALIAS =
{}
OOF_KEY_PATHS =
{
  :enabled?   => [:oof_settings, :oof_state],
  :scheduled? => [:oof_settings, :oof_state],
  :duration   => [:oof_settings, :duration],
}
OOF_KEY_TYPES =
{
  :enabled?   => ->(str){str == :enabled},
  :scheduled? => ->(str){str == :scheduled},
  :duration   => ->(hsh){ hsh[:start_time]..hsh[:end_time] },
}
OOF_KEY_ALIAS =
{}

Constants included from StringUtils

StringUtils::DURATION_RE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from StringUtils

included

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_sym, *arguments, &block) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/ews/types.rb', line 24

def method_missing(method_sym, *arguments, &block)
  if method_keys.include?(method_sym)
    type_convert( method_sym, resolve_method(method_sym) )
  else
    super
  end
end

Instance Attribute Details

#ews_itemObject (readonly)

Returns the value of attribute ews_item.



13
14
15
# File 'lib/ews/types.rb', line 13

def ews_item
  @ews_item
end

Instance Method Details

#auto_deepen?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/ews/types.rb', line 57

def auto_deepen?
  ews.auto_deepen
end

#deepen!Object Also known as: enlighten!



61
62
63
64
65
66
67
# File 'lib/ews/types.rb', line 61

def deepen!
  if shallow?
    self.get_all_properties!
    @shallow = false
    true
  end
end

#ews_methodsObject



83
84
85
# File 'lib/ews/types.rb', line 83

def ews_methods
  key_paths.keys + key_alias.keys
end

#freeze!Object

Parameters:

  • ronly (Boolean)

    true to freeze



41
42
43
# File 'lib/ews/types.rb', line 41

def freeze!
  @frozen = true
end

#frozen?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/ews/types.rb', line 36

def frozen?
  @frozen
end

#initialize(ews, ews_item) ⇒ Object

Parameters:



17
18
19
20
21
22
# File 'lib/ews/types.rb', line 17

def initialize(ews, ews_item)
  @ews      = ews
  @ews_item = ews_item
  @shallow  = true
  @frozen = false
end

#mark_deep!Object



53
54
55
# File 'lib/ews/types.rb', line 53

def mark_deep!
  @shallow = false
end

#methods(include_super = true) ⇒ Object



79
80
81
# File 'lib/ews/types.rb', line 79

def methods(include_super = true)
  super + ews_methods
end

#respond_to?(method_sym, include_private = false) ⇒ Boolean



71
72
73
74
75
76
77
# File 'lib/ews/types.rb', line 71

def respond_to?(method_sym, include_private = false)
  if method_keys.include?(method_sym)
    true
  else
    super
  end
end

#shallow?Boolean

Returns:

  • (Boolean)


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

def shallow?
  @shallow
end

#to_sObject



32
33
34
# File 'lib/ews/types.rb', line 32

def to_s
  "#{self.class.name}: EWS METHODS: #{self.ews_methods.sort.join(', ')}"
end

#unfreeze!Object



45
46
47
# File 'lib/ews/types.rb', line 45

def unfreeze!
  @frozen = false
end