Sha256: 272a4fda72c2a49aa24c543bff79bc307d89a94adb4f1ffa3770de174cdaf6e8

Contents?: true

Size: 440 Bytes

Versions: 52

Compression:

Stored size: 440 Bytes

Contents

module Timetrap
  module Formatters
    class Csv
      attr_reader :output

      def initialize entries
        @output = entries.inject("start,end,note,sheet\n") do |out, e|
          next(out) unless e.end
          out << %|"#{e.start.strftime(time_format)}","#{e.end.strftime(time_format)}","#{e.note}","#{e.sheet}"\n|
        end
      end

      private
      def time_format
        "%Y-%m-%d %H:%M:%S"
      end
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
timetrap-1.15.2 lib/timetrap/formatters/csv.rb
timetrap-1.15.1 lib/timetrap/formatters/csv.rb
timetrap-1.14.3 lib/timetrap/formatters/csv.rb
timetrap-1.15.0 lib/timetrap/formatters/csv.rb
timetrap-1.14.2 lib/timetrap/formatters/csv.rb
timetrap-1.14.1 lib/timetrap/formatters/csv.rb
timetrap-1.14.0 lib/timetrap/formatters/csv.rb
timetrap-1.13.0 lib/timetrap/formatters/csv.rb
timetrap-1.12.0 lib/timetrap/formatters/csv.rb
timetrap-1.11.0 lib/timetrap/formatters/csv.rb
timetrap-1.10.0 lib/timetrap/formatters/csv.rb
timetrap-1.9.0 lib/timetrap/formatters/csv.rb
timetrap-1.8.14 lib/timetrap/formatters/csv.rb
timetrap-1.8.13 lib/timetrap/formatters/csv.rb
timetrap-1.8.12 lib/timetrap/formatters/csv.rb
timetrap-1.8.11 lib/timetrap/formatters/csv.rb
timetrap-1.8.10 lib/timetrap/formatters/csv.rb
timetrap-1.8.9 lib/timetrap/formatters/csv.rb
timetrap-1.8.8 lib/timetrap/formatters/csv.rb
timetrap-1.8.7 lib/timetrap/formatters/csv.rb