Class: CutePrint::TermWidth Private
- Defined in:
- lib/cute_print/term_width.rb,
lib/cute_print/term_width/static.rb,
lib/cute_print/term_width/detected.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Defined Under Namespace
Class Method Summary collapse
-
.make(width) ⇒ #width, #visible
private
Given a width, make an appropriate TermWidth object.
Class Method Details
.make(width) ⇒ #width, #visible
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Given a width, make an appropriate TermWidth object. The object returned has these readers:
-
#width [Integer] Return the actual terminal width
-
#visible [Object] Return the terminal width that #Configuration#term_width should return.
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/cute_print/term_width.rb', line 17 def self.make(width) case width when Integer Static.new(width) when :detect Detected.new else raise ArgumentError, "Invalid terminal width: #{width.inspect}" end end |