Class: LlmCostTracker::Reconciliation::ImportResult

Inherits:
Data
  • Object
show all
Defined in:
lib/llm_cost_tracker/reconciliation/import_result.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors

Returns:

  • (Object)

    the current value of errors



5
6
7
# File 'lib/llm_cost_tracker/reconciliation/import_result.rb', line 5

def errors
  @errors
end

#import_idObject (readonly)

Returns the value of attribute import_id

Returns:

  • (Object)

    the current value of import_id



5
6
7
# File 'lib/llm_cost_tracker/reconciliation/import_result.rb', line 5

def import_id
  @import_id
end

#insertedObject (readonly)

Returns the value of attribute inserted

Returns:

  • (Object)

    the current value of inserted



5
6
7
# File 'lib/llm_cost_tracker/reconciliation/import_result.rb', line 5

def inserted
  @inserted
end

#skippedObject (readonly)

Returns the value of attribute skipped

Returns:

  • (Object)

    the current value of skipped



5
6
7
# File 'lib/llm_cost_tracker/reconciliation/import_result.rb', line 5

def skipped
  @skipped
end

#updatedObject (readonly)

Returns the value of attribute updated

Returns:

  • (Object)

    the current value of updated



5
6
7
# File 'lib/llm_cost_tracker/reconciliation/import_result.rb', line 5

def updated
  @updated
end

Class Method Details

.emptyObject



6
7
8
# File 'lib/llm_cost_tracker/reconciliation/import_result.rb', line 6

def self.empty
  new(inserted: 0, updated: 0, skipped: 0, errors: [], import_id: nil)
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/llm_cost_tracker/reconciliation/import_result.rb', line 14

def success?
  errors.empty?
end

#total_importedObject



10
11
12
# File 'lib/llm_cost_tracker/reconciliation/import_result.rb', line 10

def total_imported
  inserted + updated
end