lib/rews/folder.rb in rews-0.2.3 vs lib/rews/folder.rb in rews-0.2.4

- old
+ new

@@ -262,10 +262,17 @@ @client == other.client && @id == other.id && @change_key == other.change_key end + # a JSON compatible key for persistently identifying this folder + def key(ignore_change_key=false) + key = ["folder", id] + key << change_key if !ignore_change_key + key + end + def to_xml xml = Builder::XmlMarkup.new attrs = {:Id=>id.to_s} attrs[:ChangeKey] = change_key.to_s if change_key xml.t :FolderId, attrs @@ -296,9 +303,16 @@ def ==(other) other.is_a?(DistinguishedFolderId) && @client = other.client && @id = other.id && @mailbox_email = other.mailbox_email + end + + # a JSON compatible key for persistently identifying this folder + def key(ignore_change_key=false) + key = ["distinguished_folder", id] + key << mailbox_email if mailbox_email + key end def to_xml xml = Builder::XmlMarkup.new xml.t :DistinguishedFolderId, :Id=>id do