Class: Quby::Questionnaires::Repos::Base
- Inherits:
-
Object
- Object
- Quby::Questionnaires::Repos::Base
- Defined in:
- lib/quby/questionnaires/repos/base.rb
Direct Known Subclasses
Instance Method Summary collapse
- #all ⇒ Object
- #create!(key, sourcecode) ⇒ Object
- #exists?(key) ⇒ Boolean
- #find(key) ⇒ Object
- #timestamp(key) ⇒ Object
- #update!(key, sourcecode) ⇒ Object
Instance Method Details
#all ⇒ Object
9 10 11 |
# File 'lib/quby/questionnaires/repos/base.rb', line 9 def all keys.map { |key| find(key) } end |
#create!(key, sourcecode) ⇒ Object
25 26 27 28 29 |
# File 'lib/quby/questionnaires/repos/base.rb', line 25 def create!(key, sourcecode) fail(DuplicateQuestionnaire, key) if exists?(key) store!(key, sourcecode) find(key) end |
#exists?(key) ⇒ Boolean
17 18 19 |
# File 'lib/quby/questionnaires/repos/base.rb', line 17 def exists?(key) fail NotImplementedError end |
#find(key) ⇒ Object
13 14 15 |
# File 'lib/quby/questionnaires/repos/base.rb', line 13 def find(key) fail NotImplementedError end |
#timestamp(key) ⇒ Object
21 22 23 |
# File 'lib/quby/questionnaires/repos/base.rb', line 21 def (key) fail NotImplementedError end |
#update!(key, sourcecode) ⇒ Object
31 32 33 34 35 |
# File 'lib/quby/questionnaires/repos/base.rb', line 31 def update!(key, sourcecode) fail(QuestionnaireNotFound, key) unless exists?(key) store!(key, sourcecode) find(key) end |