Class: Rews::Folder::Folder

Inherits:
Object
  • Object
show all
Defined in:
lib/rews/folder.rb

Overview

represents a Folder in a mailbox on an Exchange server

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, folder) ⇒ Folder

Returns a new instance of Folder.



10
11
12
13
14
# File 'lib/rews/folder.rb', line 10

def initialize(client, folder)
  @client = client
  @folder_id = VanillaFolderId.new(client, folder[:folder_id])
  @attributes = folder
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



8
9
10
# File 'lib/rews/folder.rb', line 8

def attributes
  @attributes
end

#clientObject (readonly)

Returns the value of attribute client.



6
7
8
# File 'lib/rews/folder.rb', line 6

def client
  @client
end

#folder_idObject (readonly)

Returns the value of attribute folder_id.



7
8
9
# File 'lib/rews/folder.rb', line 7

def folder_id
  @folder_id
end

Instance Method Details

#==(other) ⇒ Object



16
17
18
19
20
21
# File 'lib/rews/folder.rb', line 16

def ==(other)
  other.is_a?(Folder) &&
    @client == other.client &&
    @folder_id == other.folder_id &&
    @attributes == other.attributes
end

#[](key) ⇒ Object

access the Folder attributes



24
25
26
# File 'lib/rews/folder.rb', line 24

def [](key)
  @attributes[key]
end

#inspectObject



33
34
35
# File 'lib/rews/folder.rb', line 33

def inspect
  "#<#{self.class} @folder_id=#{@folder_id.inspect}, @attributes=#{@attributes.inspect}>"
end

#keysObject

keys of the Folder attributes



29
30
31
# File 'lib/rews/folder.rb', line 29

def keys
  @attributes.keys
end