Class: Ppl::Adapter::Storage

Inherits:
Object
  • Object
show all
Defined in:
lib/ppl/adapter/storage.rb

Direct Known Subclasses

Disk, Git

Defined Under Namespace

Classes: Disk, Factory, Git

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.create_address_book(path) ⇒ Object

Raises:

  • (NotImplementedError)


3
4
5
# File 'lib/ppl/adapter/storage.rb', line 3

def self.create_address_book(path)
  raise NotImplementedError
end

Instance Method Details

#delete_contact(contact) ⇒ Object

Raises:

  • (NotImplementedError)


7
8
9
# File 'lib/ppl/adapter/storage.rb', line 7

def delete_contact(contact)
  raise NotImplementedError
end

#load_address_bookObject

Raises:

  • (NotImplementedError)


11
12
13
# File 'lib/ppl/adapter/storage.rb', line 11

def load_address_book
  raise NotImplementedError
end

#load_contact(id) ⇒ Object

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/ppl/adapter/storage.rb', line 15

def load_contact(id)
  raise NotImplementedError
end

#pathObject

Raises:

  • (NotImplementedError)


31
32
33
# File 'lib/ppl/adapter/storage.rb', line 31

def path
  raise NotImplementedError
end

#require_contact(id) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/ppl/adapter/storage.rb', line 19

def require_contact(id)
  contact = load_contact(id)
  if contact.nil?
    raise Ppl::Error::ContactNotFound, id
  end
  return contact
end

#save_contact(contact) ⇒ Object

Raises:

  • (NotImplementedError)


27
28
29
# File 'lib/ppl/adapter/storage.rb', line 27

def save_contact(contact)
  raise NotImplementedError
end