Module: Remedy::ANSI::Screen

Extended by:
Remedy::ANSI
Defined in:
lib/remedy/ansi.rb

Class Method Summary collapse

Methods included from Remedy::ANSI

color, command, cursor, e, esc, push, pushe, pushesc, screen

Class Method Details

.clear!Object



169
170
171
# File 'lib/remedy/ansi.rb', line 169

def clear!
  ANSI.command.clear_screen!
end

.codeObject



151
152
153
154
155
156
# File 'lib/remedy/ansi.rb', line 151

def code
  {
    up:   'M',
    down: 'D'
  }
end

.down!(count = 1) ⇒ Object



177
178
179
# File 'lib/remedy/ansi.rb', line 177

def down!  count = 1
  count.times { pushe code[:down] }
end

.reset!Object



158
159
160
161
162
# File 'lib/remedy/ansi.rb', line 158

def reset!
  ANSI.color.reset!
  ANSI.cursor.home!
  clear!
end

.safe_reset!Object



164
165
166
167
# File 'lib/remedy/ansi.rb', line 164

def safe_reset!
  ANSI.cursor.home!
  ANSI.command.clear_down!
end

.up!(count = 1) ⇒ Object



173
174
175
# File 'lib/remedy/ansi.rb', line 173

def up! count = 1
  count.times { pushe code[:up] }
end