Class: RExchange::Message
- Inherits:
-
GenericItem
- Object
- GenericItem
- RExchange::Message
- Defined in:
- lib/rexchange/message.rb
Instance Attribute Summary
Attributes inherited from GenericItem
Instance Method Summary collapse
-
#move_to(folder) ⇒ Object
Move this message to the specified folder.
- #to_s ⇒ Object
Methods inherited from GenericItem
attribute_mappings, find, inherited, #initialize, set_content_class, set_folder_type
Constructor Details
This class inherits a constructor from RExchange::GenericItem
Instance Method Details
#move_to(folder) ⇒ Object
Move this message to the specified folder. The folder can be a string such as ‘inbox/archive’ or a RExchange::Folder.
Example
mailbox.inbox.each do ||
.move_to mailbox.inbox.archive
end
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/rexchange/message.rb', line 24 def move_to(folder) source = URI.parse(self.href).path destination = if folder.is_a?(RExchange::Folder) folder.to_s.ensure_ends_with('/') + source.split('/').last else @session.uri.path.ensure_ends_with('/') + folder.to_s.ensure_ends_with('/') + source.split('/').last end # $log.debug "move_to: source => \"#{source}\", destination => \"#{destination}\"" DavMoveRequest.execute(@session, source, destination) end |
#to_s ⇒ Object
37 38 39 |
# File 'lib/rexchange/message.rb', line 37 def to_s "To: #{to}, From: #{from}, Subject: #{subject}" end |