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.
48 49 50 |
# File 'lib/neovim/output.rb', line 48 def initialize client, *rest @client = client end |
Class Method Details
.open(*args, **kwargs) ⇒ Object
41 42 43 44 45 46 |
# File 'lib/neovim/output.rb', line 41 def open *args, **kwargs i = new *args, **kwargs yield i ensure i.finish end |
Instance Method Details
#<<(arg) ⇒ Object
51 52 53 54 |
# File 'lib/neovim/output.rb', line 51 def << arg write arg.to_s self end |
#flush ⇒ Object
78 79 |
# File 'lib/neovim/output.rb', line 78 def flush end |
#print(*args) ⇒ Object
55 56 57 58 |
# File 'lib/neovim/output.rb', line 55 def print *args args.each { |a| write a.to_s } nil end |
#puts(*args) ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/neovim/output.rb', line 59 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 |