Class: Rews::Client
- Inherits:
-
Object
- Object
- Rews::Client
- Defined in:
- lib/rews.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#logdev ⇒ Object
Returns the value of attribute logdev.
Instance Method Summary collapse
-
#distinguished_folder_id(id, mailbox_email = nil) ⇒ Object
client.distinguished_folder_id(‘inbox’) client.distinguished_folder_id(‘inbox’, ‘[email protected]’) # to get a folder from another mailbox.
-
#initialize(endpoint, auth_type, user, password) ⇒ Client
constructor
Rews::Client.new(‘exchange.foo.com/EWS/Exchange.asmx’, :ntlm, ‘DOMAIN\user’, ‘password’) Rews::Client.new(‘exchange.foo.com/EWS/Exchange.asmx’, :basic, ‘DOMAIN\user’, ‘password’).
- #log {|logger| ... } ⇒ Object
- #logger ⇒ Object
Constructor Details
#initialize(endpoint, auth_type, user, password) ⇒ Client
Rews::Client.new(‘exchange.foo.com/EWS/Exchange.asmx’, :ntlm, ‘DOMAIN\user’, ‘password’) Rews::Client.new(‘exchange.foo.com/EWS/Exchange.asmx’, :basic, ‘DOMAIN\user’, ‘password’)
30 31 32 33 34 35 36 37 38 |
# File 'lib/rews.rb', line 30 def initialize(endpoint, auth_type, user, password) @client = Savon::Client.new do wsdl.endpoint = endpoint wsdl.namespace = SCHEMA_MESSAGES http.auth.ssl.verify_mode = :none http.auth.send(auth_type, user, password) end end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
25 26 27 |
# File 'lib/rews.rb', line 25 def client @client end |
#logdev ⇒ Object
Returns the value of attribute logdev.
26 27 28 |
# File 'lib/rews.rb', line 26 def logdev @logdev end |
Instance Method Details
#distinguished_folder_id(id, mailbox_email = nil) ⇒ Object
client.distinguished_folder_id(‘inbox’) client.distinguished_folder_id(‘inbox’, ‘[email protected]’) # to get a folder from another mailbox
42 43 44 |
# File 'lib/rews.rb', line 42 def distinguished_folder_id(id, mailbox_email=nil) Folder::DistinguishedFolderId.new(client, id, mailbox_email) end |
#log {|logger| ... } ⇒ Object
46 47 48 |
# File 'lib/rews.rb', line 46 def log yield logger if @logdev end |
#logger ⇒ Object
50 51 52 53 |
# File 'lib/rews.rb', line 50 def logger return @logger if @logger @logger = Logger.new(@logdev) if @logdev end |