Class: SipoMailer::Models::AddressBook
- Inherits:
-
Object
- Object
- SipoMailer::Models::AddressBook
- Defined in:
- lib/sipo_mailer/models/address_book.rb
Instance Attribute Summary collapse
-
#book ⇒ Object
readonly
Returns the value of attribute book.
-
#contacts ⇒ Object
readonly
Returns the value of attribute contacts.
Class Method Summary collapse
Instance Method Summary collapse
- #find(id) ⇒ Object
-
#initialize ⇒ AddressBook
constructor
A new instance of AddressBook.
Constructor Details
#initialize ⇒ AddressBook
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
#book ⇒ Object (readonly)
Returns the value of attribute book.
5 6 7 |
# File 'lib/sipo_mailer/models/address_book.rb', line 5 def book @book end |
#contacts ⇒ Object (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 |