Class: Tarzan::Interfaces::Campfire::Interface
- Inherits:
-
Base::Interface
- Object
- Base::Interface
- Tarzan::Interfaces::Campfire::Interface
- Defined in:
- lib/tarzan/interfaces/campfire/interface.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Interface
constructor
A new instance of Interface.
- #prompt(valid_choices = []) ⇒ Object
- #say(message) ⇒ Object
Methods inherited from Base::Interface
Constructor Details
#initialize(options = {}) ⇒ Interface
Returns a new instance of Interface.
9 10 11 |
# File 'lib/tarzan/interfaces/campfire/interface.rb', line 9 def initialize( = {}) @room = Nico::Room.new end |
Instance Method Details
#prompt(valid_choices = []) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/tarzan/interfaces/campfire/interface.rb', line 17 def prompt(valid_choices = []) say %{Pick one: #{valid_choices.join ' - '} } @room. do || return if valid_choices.include?() end end |
#say(message) ⇒ Object
13 14 15 |
# File 'lib/tarzan/interfaces/campfire/interface.rb', line 13 def say() @room.say end |