Sha256: 5ef4ae5e32d6fba2b832a7d4f7bfc777d93ca5eac710c3bb30f01c7255520fae

Contents?: true

Size: 1.44 KB

Versions: 11

Compression:

Stored size: 1.44 KB

Contents

# Author::    Eric Crane  (mailto:eric.crane@mac.com)
# Copyright:: Copyright (c) 2022 Eric Crane.  All rights reserved.
#
# Handle input and output for the current platform.
#
# This is an abstract base class and minimal implementation
# is only to facilitate testing.
#

module GlooLang
  module App
    class Platform

      #
      # Set up Platform.
      #
      def initialize
      end

      #
      # Show a message.
      # Abstract--implment in subclass.
      #
      def show( msg, md=false, page=false )
        puts msg
      end

      #
      # Prompt for the next command.
      # Abstract--implment in subclass.
      #
      def prompt_cmd
        return ''
      end

      #
      # Clear the screen.
      # Abstract--implment in subclass.
      #
      def clear_screen
      end

      #
      # Edit some temporary text and return the edited text.
      # Abstract--implment in subclass.
      #
      def edit initial_value
        return initial_value
      end

      #
      # Show the given table data.
      # Abstract--implment in subclass.
      #
      def show_table( headers, data, title = nil )
      end

      #
      # Get the number of vertical lines on screen.
      # Abstract--implment in subclass.
      #
      def lines
        return 40
      end

      #
      # Get the number of horizontal columns on screen.
      # Abstract--implment in subclass.
      #
      def cols
        return 80
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
gloo-lang-1.1.0 lib/gloo_lang/app/platform.rb
gloo-lang-1.0.2 lib/gloo_lang/app/platform.rb
gloo-lang-1.0.1 lib/gloo_lang/app/platform.rb
gloo-lang-1.0.0 lib/gloo_lang/app/platform.rb
gloo-lang-0.9.11 lib/gloo_lang/app/platform.rb
gloo-lang-0.9.10 lib/gloo_lang/app/platform.rb
gloo-lang-0.9.9 lib/gloo_lang/app/platform.rb
gloo-lang-0.9.8 lib/gloo_lang/app/platform.rb
gloo-lang-0.9.7 lib/gloo_lang/app/platform.rb
gloo-lang-0.9.6 lib/gloo_lang/app/platform.rb
gloo-lang-0.9.5 lib/gloo_lang/app/platform.rb