Module: OperaContacts::Collection

Includes:
Enumerable
Included in:
ContactCollection, ContactFolder
Defined in:
lib/opera-contacts/contacts.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#itemsObject (readonly)

Returns the value of attribute items.



15
16
17
# File 'lib/opera-contacts/contacts.rb', line 15

def items
  @items
end

Instance Method Details

#<<(item) ⇒ Object



16
17
18
19
# File 'lib/opera-contacts/contacts.rb', line 16

def <<(item)
  @items = [] if @items.nil?
  @items << item
end

#contactsObject



25
26
27
# File 'lib/opera-contacts/contacts.rb', line 25

def contacts
  return self.find_all{|i| i.is_a? Contact}
end

#each(&block) ⇒ Object



30
31
32
33
# File 'lib/opera-contacts/contacts.rb', line 30

def each(&block)
  @items = [] if @items.nil?
  @items.each(&block)
end

#foldersObject



21
22
23
# File 'lib/opera-contacts/contacts.rb', line 21

def folders
  return self.find_all{|i| i.is_a? ContactFolder}
end