Sha256: 5cf15f831cfcaa0ea71e1e4c0afc5b93b0bbaf149a5c7b2033c9b773dc65d166

Contents?: true

Size: 435 Bytes

Versions: 1

Compression:

Stored size: 435 Bytes

Contents

require 'tarzan/interfaces/base/interface'

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

        def say(message)
          puts message
        end

        def prompt(valid_choices = [])
          say %{Pick one: #{valid_choices.join ' - '} }
          choice = gets.strip
          valid_choices.include?(choice) ? choice : prompt(valid_choices)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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