Class: Neovim::Write
Class Method Summary collapse
Instance Method Summary collapse
- #<<(arg) ⇒ Object
- #flush ⇒ Object
-
#initialize(client, *rest) ⇒ Write
constructor
A new instance of Write.
- #print(*args) ⇒ Object
- #puts(*args) ⇒ Object
Constructor Details
#initialize(client, *rest) ⇒ Write
Returns a new instance of Write.
17 18 19 |
# File 'lib/neovim/output.rb', line 17 def initialize client, *rest @client = client end |
Class Method Details
.open(*args, **kwargs) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/neovim/output.rb', line 10 def open *args, **kwargs i = new *args, **kwargs yield i ensure i.finish end |
Instance Method Details
#<<(arg) ⇒ Object
20 21 22 23 |
# File 'lib/neovim/output.rb', line 20 def << arg write arg.to_s self end |
#flush ⇒ Object
47 48 |
# File 'lib/neovim/output.rb', line 47 def flush end |
#print(*args) ⇒ Object
24 25 26 27 |
# File 'lib/neovim/output.rb', line 24 def print *args args.each { |a| write a.to_s } nil end |
#puts(*args) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/neovim/output.rb', line 28 def puts *args if args.empty? then write $/ else args.each { |a| case a when Array then a.each { |e| puts e } else a = a.to_s write a write $/ unless a.end_with? $/ end } end nil end |