class IO - io-console-0.4.6 Documentation

# class IO

### Public Class Methods

console_size() click to toggle source

returns console window size

    # File lib/console/size.rb, line 18
    def IO.console_size
      console.winsize
    rescue NoMethodError
      default_console_size
    end

default_console_size() click to toggle source

frozen_string_literal: false fallback to console window size

    # File lib/console/size.rb, line 3
    def IO.default_console_size
      [
        ENV["LINES"].to_i.nonzero? || 25,
        ENV["COLUMNS"].to_i.nonzero? || 80,
      ]
    end