class Quby::Questionnaires::Repos::Base

Public Instance Methods

all() click to toggle source
# File lib/quby/questionnaires/repos/base.rb, line 9
def all
  keys.map { |key| find(key) }
end
create!(key, sourcecode) click to toggle source
# 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) click to toggle source
# File lib/quby/questionnaires/repos/base.rb, line 17
def exists?(key)
  fail NotImplementedError
end
find(key) click to toggle source
# File lib/quby/questionnaires/repos/base.rb, line 13
def find(key)
  fail NotImplementedError
end
timestamp(key) click to toggle source
# File lib/quby/questionnaires/repos/base.rb, line 21
def timestamp(key)
  fail NotImplementedError
end
update!(key, sourcecode) click to toggle source
# 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

Private Instance Methods

entity(key, sourcecode, timestamp, path) click to toggle source
# File lib/quby/questionnaires/repos/base.rb, line 43
def entity(key, sourcecode, timestamp, path)
  Entities::Definition.new(key: key, sourcecode: sourcecode, timestamp: timestamp, path: path)
end
store!(key, sourcecode) click to toggle source
# File lib/quby/questionnaires/repos/base.rb, line 39
def store!(key, sourcecode)
  fail NotImplementedError
end