Class: Rews::Item::Item
- Inherits:
-
Object
- Object
- Rews::Item::Item
- Defined in:
- lib/rews/item.rb
Overview
represents an Item from a mailbox on an Exchange server
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#item_class ⇒ Object
readonly
Returns the value of attribute item_class.
-
#item_id ⇒ Object
readonly
Returns the value of attribute item_id.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#[](key) ⇒ Object
access the Item attributes.
-
#initialize(client, item_class, attributes) ⇒ Item
constructor
A new instance of Item.
- #inspect ⇒ Object
-
#keys ⇒ Object
names of the Item attributes.
Constructor Details
#initialize(client, item_class, attributes) ⇒ Item
Returns a new instance of Item.
31 32 33 34 35 36 |
# File 'lib/rews/item.rb', line 31 def initialize(client, item_class, attributes) @client = client @item_id = ItemId.new(client, attributes[:item_id]) @item_class = item_class @attributes = attributes || {} end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
29 30 31 |
# File 'lib/rews/item.rb', line 29 def attributes @attributes end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
26 27 28 |
# File 'lib/rews/item.rb', line 26 def client @client end |
#item_class ⇒ Object (readonly)
Returns the value of attribute item_class.
28 29 30 |
# File 'lib/rews/item.rb', line 28 def item_class @item_class end |
#item_id ⇒ Object (readonly)
Returns the value of attribute item_id.
27 28 29 |
# File 'lib/rews/item.rb', line 27 def item_id @item_id end |
Instance Method Details
#==(other) ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/rews/item.rb', line 38 def ==(other) other.is_a?(Item) && @client == other.client && @item_id == other.item_id && @item_class == other.item_class && @attributes == other.attributes end |
#[](key) ⇒ Object
access the Item attributes
47 48 49 |
# File 'lib/rews/item.rb', line 47 def [](key) @attributes[key] end |
#inspect ⇒ Object
56 57 58 |
# File 'lib/rews/item.rb', line 56 def inspect "#<#{self.class} @item_class=#{@item_class}, @item_id=#{@folder_id.inspect}, @attributes=#{@attributes.inspect}>" end |
#keys ⇒ Object
names of the Item attributes
52 53 54 |
# File 'lib/rews/item.rb', line 52 def keys @attributes.keys end |