Sha256: 3baffdeec8659b94f7f818fb484ffbc07fb61b95ec6ff2b159c19da8d37ccf04

Contents?: true

Size: 349 Bytes

Versions: 13

Compression:

Stored size: 349 Bytes

Contents

class Knj::Csv
  def self.arr_to_csv(arr, del, encl)
    str = ""
    first = true
    arr.each do |val|
      if first
        first = false
      else
        str << del
      end
      
      val = val.to_s.encode("utf-8").gsub(del, "").gsub(encl, "")
      str << "#{encl}#{val}#{encl}"
    end
    
    str << "\n"
    
    return str
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
knjrbfw-0.0.21 lib/knj/csv.rb
knjrbfw-0.0.20 lib/knj/csv.rb
knjrbfw-0.0.19 lib/knj/csv.rb
knjrbfw-0.0.18 lib/knj/csv.rb
knjrbfw-0.0.17 lib/knj/csv.rb
knjrbfw-0.0.16 lib/knj/csv.rb
knjrbfw-0.0.15 lib/knj/csv.rb
knjrbfw-0.0.14 lib/knj/csv.rb
knjrbfw-0.0.13 lib/knj/csv.rb
knjrbfw-0.0.12 lib/knj/csv.rb
knjrbfw-0.0.11 lib/knj/csv.rb
knjrbfw-0.0.10 lib/knj/csv.rb
knjrbfw-0.0.9 lib/knj/csv.rb