Sha256: 981dd74c75ba50e95fc105927c0eb5471571490ef3c416e48f1bec8a88fa0095

Contents?: true

Size: 563 Bytes

Versions: 1

Compression:

Stored size: 563 Bytes

Contents

require 'tarzan/interfaces/base/interface'
require 'nico'

module Tarzan
  module Interfaces
    module Campfire
      class Interface < Base::Interface

        def initialize(options = {})
          @room = Nico::Room.new options
        end

        def say(message)
          @room.say message
        end

        def prompt(valid_choices = [])
          say %{Pick one: #{valid_choices.join ' - '} }
          @room.each_message do |message|
            return message if valid_choices.include?(message)
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tarzan-0.0.3 lib/tarzan/interfaces/campfire/interface.rb