Class: SipoMailer::Models::AddressBook

Inherits:
Object
  • Object
show all
Defined in:
lib/sipo_mailer/models/address_book.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAddressBook

Returns a new instance of AddressBook.



7
8
9
10
# File 'lib/sipo_mailer/models/address_book.rb', line 7

def initialize
  @file     = load_book
  @contacts = without_dups
end

Instance Attribute Details

#bookObject (readonly)

Returns the value of attribute book.



5
6
7
# File 'lib/sipo_mailer/models/address_book.rb', line 5

def book
  @book
end

#contactsObject (readonly)

Returns the value of attribute contacts.



5
6
7
# File 'lib/sipo_mailer/models/address_book.rb', line 5

def contacts
  @contacts
end

Class Method Details

.find(id) ⇒ Object



12
13
14
# File 'lib/sipo_mailer/models/address_book.rb', line 12

def self.find(id)
  new.find(id)
end

Instance Method Details

#find(id) ⇒ Object



16
17
18
# File 'lib/sipo_mailer/models/address_book.rb', line 16

def find(id)
  find_all(id).first
end