Class: Barker::Repo::Memory::GameShow

Inherits:
Object
  • Object
show all
Includes:
Errors
Defined in:
lib/barker/repo/memory/game_show.rb

Constant Summary

Constants included from Errors

Errors::AlreadyAnsweredError, Errors::AlreadyStartedError, Errors::AnswerNotFoundError, Errors::BarkerError, Errors::FileNotExistError, Errors::HasToRespondToIdError, Errors::HasToRespondToLocaleError, Errors::JokerAlreadyUsedError, Errors::NoCurrentStageError, Errors::NotStartedError, Errors::RecordNotFound, Errors::UnknownJokerError

Instance Method Summary collapse

Instance Method Details

#add(game_show) ⇒ Object



8
9
10
# File 'lib/barker/repo/memory/game_show.rb', line 8

def add(game_show)
  store.add game_show
end

#around(game_show_id) {|game_show| ... } ⇒ Object

Yields:

  • (game_show)


24
25
26
27
28
# File 'lib/barker/repo/memory/game_show.rb', line 24

def around(game_show_id)
  game_show = store.get game_show_id.to_s
  yield game_show
  store.update game_show
end

#get(game_show_id) ⇒ Object



12
13
14
# File 'lib/barker/repo/memory/game_show.rb', line 12

def get(game_show_id)
  store.get(game_show_id.to_s) || raise(RecordNotFound)
end

#remove(game_show) ⇒ Object



20
21
22
# File 'lib/barker/repo/memory/game_show.rb', line 20

def remove(game_show)
  store.remove(game_show)
end

#update(game_show) ⇒ Object



16
17
18
# File 'lib/barker/repo/memory/game_show.rb', line 16

def update(game_show)
  store.update game_show
end