Class: FTT::Util
- Inherits:
-
Object
- Object
- FTT::Util
- Defined in:
- lib/fancy_terminal_text/util.rb
Class Method Summary collapse
Class Method Details
.term_dimensions ⇒ Object
5 6 7 8 |
# File 'lib/fancy_terminal_text/util.rb', line 5 def self.term_dimensions height, width = `stty size`.chomp.split(' ').map(&:to_i) OpenStruct.new(width: width, height: height) end |
.term_height ⇒ Object
14 15 16 |
# File 'lib/fancy_terminal_text/util.rb', line 14 def self.term_height term_dimensions.height end |
.term_width ⇒ Object
10 11 12 |
# File 'lib/fancy_terminal_text/util.rb', line 10 def self.term_width term_dimensions.width end |