Class: IO
- Inherits:
-
Object
- Object
- IO
- Defined in:
- lib/xqsr3/doc_.rb,
lib/xqsr3/extensions/io/writelines.rb
Overview
Standard class, extended with methods:
-
IO#writelines
Class Method Summary collapse
-
.writelines(path, contents, *args) ⇒ Object
Extends
IO
class with the::Xqsr3::IO::write_lines
method.
Class Method Details
.writelines(path, contents, *args) ⇒ Object
Extends IO
class with the ::Xqsr3::IO::write_lines
method
def self.writelines(path, contents, lineSep = nil, columnSep = nil)
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/xqsr3/extensions/io/writelines.rb', line 62 def self.writelines(path, contents, *args) = {} case args.size when 0 ; when 1 arg3 = args[0] if arg3.respond_to?(:to_hash) .merge! arg3.to_hash else [:line_separator] = arg3 end when 2 arg3 = args[0] arg4 = args[1] [:line_separator] = arg3 [:column_separator] = arg4 else raise ArgumentError, "wrong number of arguments (given #{2 + args.size}, expected 2..4)" end ::Xqsr3::IO.writelines path, contents, ** end |