Class: Dotloop::DocumentActivity
- Inherits:
-
Object
- Object
- Dotloop::DocumentActivity
- Includes:
- QueryParamHelpers
- Defined in:
- lib/dotloop/document_activity.rb
Constant Summary
Constants included from QueryParamHelpers
QueryParamHelpers::BATCH_SIZE, QueryParamHelpers::MAX_LOOPS
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
- #all(options = {}) ⇒ Object
-
#initialize(client:) ⇒ DocumentActivity
constructor
A new instance of DocumentActivity.
Constructor Details
#initialize(client:) ⇒ DocumentActivity
Returns a new instance of DocumentActivity.
6 7 8 |
# File 'lib/dotloop/document_activity.rb', line 6 def initialize(client:) @client = client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
4 5 6 |
# File 'lib/dotloop/document_activity.rb', line 4 def client @client end |
Instance Method Details
#all(options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/dotloop/document_activity.rb', line 10 def all( = {}) activities = [] url = "/profile/#{profile_id()}/document/#{document_id()}/activity" (1..MAX_LOOPS).each do |i| [:batch_number] = i current_activity = @client.get(url, query_params()).map do |act_attrs| Dotloop::Models::DocumentActivity.new(act_attrs) end activities += current_activity break if current_activity.size < BATCH_SIZE end activities end |