Sha256: 84b89bad674f2c4f28a9d8cf41598152b7cfd59ab434683c17e579fec9821fd6

Contents?: true

Size: 534 Bytes

Versions: 4

Compression:

Stored size: 534 Bytes

Contents

module Harvesting
  module Models
    class TimeEntries < HarvestRecordCollection

      def initialize(attrs, query_opts = {}, opts = {})
        super(attrs.reject {|k,v| k == "time_entries" }, query_opts, opts)
        @entries = attrs["time_entries"].map do |entry|
          TimeEntry.new(entry, harvest_client: opts[:harvest_client])
        end
      end

      def fetch_next_page
        @entries += harvest_client.time_entries(next_page_query_opts).entries
        @attributes['page'] = page + 1
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
harvesting-0.6.0 lib/harvesting/models/time_entries.rb
harvesting-0.5.1 lib/harvesting/models/time_entries.rb
harvesting-0.5.0 lib/harvesting/models/time_entries.rb
harvesting-0.4.0 lib/harvesting/models/time_entries.rb