class ABBYY::Cloud::Namespaces::Prices

Namespace for operations with prices @see [api.abbyy.cloud/swagger/ui/index#!/Prices] ABBYY Cloud API

Constants

MAX_PER_REQUEST

Public Instance Methods

details(skip: 0, take: nil, **opts) click to toggle source

Returns prices data filtered by type of translated object, source and target language.

If take option is NOT set, the method makes as many requests as necessary to get all prices.

# File lib/abbyy/cloud/namespaces/prices.rb, line 16
def details(skip: 0, take: nil, **opts)
  take_now   = (take && take <= MAX_PER_REQUEST) ? take : MAX_PER_REQUEST
  take_later = take - take_now if take
  skip_later = skip + take_now

  items = Operations::Prices.new(settings)
                            .call(skip: skip, take: take_now, **opts)

  return items if (items.count < take_now) || take_later&.zero?
  items + details(skip: skip_later, take: take_later, **opts)
end