Sha256: d9abf8c5af190e264f5d433662358c68e8e5a921628d417394ed2c5c64c70e26

Contents?: true

Size: 486 Bytes

Versions: 1

Compression:

Stored size: 486 Bytes

Contents

module Harvesting
  module Models
    class Tasks < HarvestRecordCollection

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

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
harvesting-0.3.0 lib/harvesting/models/tasks.rb