Module: Remedy::ANSI::Cursor
Class Method Summary
collapse
color, command, cursor, e, esc, push, pushe, pushesc, screen
Class Method Details
.beginning_of_line! ⇒ Object
140
141
142
|
# File 'lib/remedy/ansi.rb', line 140
def beginning_of_line!
to_column 0
end
|
.code ⇒ Object
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
# File 'lib/remedy/ansi.rb', line 80
def code
{
home: 'H',
up: '%{lines}A',
down: '%{lines}B',
to_column: '%{column}G',
next_line: '%{lines}E',
prev_line: '%{lines}F',
show: '?25h',
hide: '?25l'
}
end
|
.down(lines = 1) ⇒ Object
102
103
104
|
# File 'lib/remedy/ansi.rb', line 102
def down lines = 1
esc code[:down] % {lines: lines}
end
|
.hide! ⇒ Object
124
125
126
|
# File 'lib/remedy/ansi.rb', line 124
def hide!
pushesc code[:hide]
end
|
.home! ⇒ Object
120
121
122
|
# File 'lib/remedy/ansi.rb', line 120
def home!
pushesc code[:home]
end
|
.next_line(lines = 1) ⇒ Object
110
111
112
113
|
# File 'lib/remedy/ansi.rb', line 110
def next_line lines = 1
down(lines) + to_column(0)
end
|
.next_line!(lines = 1) ⇒ Object
132
133
134
|
# File 'lib/remedy/ansi.rb', line 132
def next_line! lines = 1
push next_line(lines)
end
|
.prev_line(lines = 1) ⇒ Object
115
116
117
118
|
# File 'lib/remedy/ansi.rb', line 115
def prev_line lines = 1
up(lines) + to_column(0)
end
|
.prev_line!(lines = 1) ⇒ Object
136
137
138
|
# File 'lib/remedy/ansi.rb', line 136
def prev_line! lines = 1
push prev_line(lines)
end
|
.show! ⇒ Object
128
129
130
|
# File 'lib/remedy/ansi.rb', line 128
def show!
pushesc code[:show]
end
|
.to_column(column) ⇒ Object
98
99
100
|
# File 'lib/remedy/ansi.rb', line 98
def to_column column
esc code[:to_column] % {column: column}
end
|
.up(lines = 1) ⇒ Object
106
107
108
|
# File 'lib/remedy/ansi.rb', line 106
def up lines = 1
esc code[:up] % {lines: lines}
end
|