Sha256: 2a423f1354f72142856ff368afcfaa6a2e61c01a4c340aa4c0d94c41e4843e02
Contents?: true
Size: 642 Bytes
Versions: 17
Compression:
Stored size: 642 Bytes
Contents
module Moysklad::Resources module LoadAll def load_all(params = {}) limit = 100 offset = 0 rows = [] collection = nil begin collection = list params.merge(limit: limit, offset: offset) rows += collection.rows break if collection.rows.empty? offset = rows.count end while offset<collection.meta.size raise WrongEntriesCountError, "При загрузке коллекции в результате колиество не совпадает с total: #{rows.count}<>#{collection.meta.size}" unless rows.count==collection.meta.size rows end end end
Version data entries
17 entries across 17 versions & 1 rubygems