Method: Colrapi.estimate

Defined in:
lib/colrapi.rb

.estimate(dataset_id, estimate_id: nil, name: nil, rank: nil, modified_by: nil, broken: nil, min: nil, max: nil, offset: nil, limit: nil, verbose: false) ⇒ Hash, Boolean

Get estimates

Parameters:

  • dataset_id (String)

    The dataset id

  • estimate_id (Integer, nil) (defaults to: nil)

    The estimate ID

  • name (String) (defaults to: nil)

    The scientific name

  • rank (String, nil) (defaults to: nil)

    taxonomic rank

  • modified_by (Integer, nil) (defaults to: nil)

    Filter by a user id on last modified by

  • broken (Boolean, nil) (defaults to: nil)

    Whether the estimate is broken or not

  • min (Integer, nil) (defaults to: nil)

    Filter by the minimum estimate

  • max (Integer, nil) (defaults to: nil)

    Filter by the maximum estimate

  • offset (Integer) (defaults to: nil)

    Offset for pagination

  • limit (Integer) (defaults to: nil)

    Limit for pagination

  • verbose (Boolean) (defaults to: false)

    Print headers to STDOUT

Returns:

  • (Hash, Boolean)

    A results hash



199
200
201
202
203
204
205
206
207
208
209
# File 'lib/colrapi.rb', line 199

def self.estimate(dataset_id, estimate_id: nil, name: nil, rank: nil, modified_by: nil, broken: nil, min: nil,
                  max: nil, offset: nil, limit: nil, verbose: false)
  endpoint = "dataset/#{dataset_id}/estimate"
  if estimate_id.nil?
    Request.new(endpoint: endpoint, name: name, rank: rank, modified_by: modified_by, broken: broken,
                min: min, max: max, offset: offset, limit: limit, verbose: verbose).perform
  else
    endpoint = "dataset/#{dataset_id}/estimate/#{estimate_id}"
    Request.new(endpoint: endpoint, verbose: verbose).perform
  end
end