Class: DotloopApi::EndPoints::Batch

Inherits:
Base
  • Object
show all
Defined in:
lib/dotloop_api/end_points/batch.rb

Direct Known Subclasses

Activity, Contact, Loop

Constant Summary collapse

MAX_LOOPS =
500

Instance Method Summary collapse

Methods inherited from Base

#create, #delete, #find, #save, #single_path

Methods included from ModelBuilder

#build_details, #build_documents, #build_model

Instance Method Details

#all(options = {}) ⇒ Object



5
6
7
8
9
# File 'lib/dotloop_api/end_points/batch.rb', line 5

def all(options = {})
  options_to_params(options)
  return batch(options) if options[:batch_number]
  loop_over_all_batches
end

#batch(options = {}) ⇒ Object



11
12
13
14
# File 'lib/dotloop_api/end_points/batch.rb', line 11

def batch(options = {})
  options_to_params(options)
  @client.get(path, @param_helper.params)[:data].map { |attrs| build_model(attrs) }
end