Class: RExchange::Session

Inherits:
Folder
  • Object
show all
Defined in:
lib/rexchange/session.rb

Constant Summary

Constants inherited from Folder

Folder::CONTENT_TYPES

Instance Attribute Summary

Attributes inherited from Folder

#credentials, #displayname

Instance Method Summary collapse

Methods inherited from Folder

#each, #folders, #folders_hash, #make_subfolder, #message_hrefs, #method_missing, #search, #to_s

Constructor Details

#initialize(dav_uri, owa_uri, username = nil, password = nil) {|_self| ... } ⇒ Session

Creates a Credentials instance to pass to subfolders

Example

RExchange::Session.new('https://mydomain.com/exchange/demo', 'https://mydomain.com/owa/auth/owaauth.dll', 'mydomain\\bob', 'secret') do |mailbox|
  mailbox.test.each do |message|
    puts message.subject
  end
end

Yields:

  • (_self)

Yield Parameters:



16
17
18
19
20
21
22
23
24
# File 'lib/rexchange/session.rb', line 16

def initialize(dav_uri, owa_uri, username = nil, password = nil)

  @credentials = Credentials.new(dav_uri, owa_uri, username, password)
  @parent = @credentials.dav_uri.path
  @folder = ''
  @href = @credentials.dav_uri.to_s
  
  yield(self) if block_given?
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RExchange::Folder