class Tarzan::Interfaces::Base::Interface
Public Instance Methods
play()
click to toggle source
# File lib/tarzan/interfaces/base/interface.rb, line 8 def play say %{Welcome to the Game Hall} say %{Pick [R]ockPaperScissors or [O]ddsAndEvens: } game = case prompt(['R', 'O']) when 'R' then Tarzan::Games::RockPaperScissors::Game.new interface: self when 'O' then Tarzan::Games::OddsAndEvens::Game.new interface: self end game.play say %{Goodbye, and come back to the Game Hall} end
prompt(valid_choices = [])
click to toggle source
# File lib/tarzan/interfaces/base/interface.rb, line 27 def prompt(valid_choices = []) # Subclasses are expected to define how to prompt messages end
say(message)
click to toggle source
# File lib/tarzan/interfaces/base/interface.rb, line 23 def say(message) # Subclasses are expected to define how to say messages end