Class: Airtable::ORM::BatchResult

Inherits:
Struct
  • Object
show all
Defined in:
lib/airtable/orm/batch_result.rb

Overview

Holds the result of a batch update operation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(updated: [], skipped: [], failed: []) ⇒ BatchResult

Returns a new instance of BatchResult.



11
12
13
# File 'lib/airtable/orm/batch_result.rb', line 11

def initialize(updated: [], skipped: [], failed: [])
  super
end

Instance Attribute Details

#failedArray

Records that failed validation or API call

Returns:

  • (Array)

    the current value of failed



10
11
12
# File 'lib/airtable/orm/batch_result.rb', line 10

def failed
  @failed
end

#skippedArray

Records that had no changes and were not sent to the API

Returns:

  • (Array)

    the current value of skipped



10
11
12
# File 'lib/airtable/orm/batch_result.rb', line 10

def skipped
  @skipped
end

#updatedArray

Records that were successfully sent to the API and updated

Returns:

  • (Array)

    the current value of updated



10
11
12
# File 'lib/airtable/orm/batch_result.rb', line 10

def updated
  @updated
end

Instance Method Details

#any_failed?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/airtable/orm/batch_result.rb', line 19

def any_failed?
  failed.any?
end

#none_failed?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/airtable/orm/batch_result.rb', line 15

def none_failed?
  failed.empty?
end

#total_countObject



23
24
25
# File 'lib/airtable/orm/batch_result.rb', line 23

def total_count
  updated.size + skipped.size + failed.size
end