Class: Edi::Wayfair::CatalogReadV2Retriever::Result

Inherits:
Data
  • Object
show all
Defined in:
app/services/edi/wayfair/catalog_read_v2_retriever.rb

Overview

Service object: pull result.
unreturned is what we asked about and Wayfair did not hand back even on
the retry pass — the closest thing the API gives us to "no such SKU".

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(batches: 0, requested: 0, matched: 0, updated: 0, unreturned: [], errors: []) ⇒ Result

Parameters:

  • batches (Integer) (defaults to: 0)
  • requested (Integer) (defaults to: 0)
  • matched (Integer) (defaults to: 0)
  • updated (Integer) (defaults to: 0)
  • unreturned (Array<String>) (defaults to: [])
  • errors (Array<String>) (defaults to: [])


75
# File 'app/services/edi/wayfair/catalog_read_v2_retriever.rb', line 75

def initialize(batches: 0, requested: 0, matched: 0, updated: 0, unreturned: [], errors: []) = super

Instance Attribute Details

#batchesObject (readonly)

Returns the value of attribute batches

Returns:

  • (Object)

    the current value of batches



67
68
69
# File 'app/services/edi/wayfair/catalog_read_v2_retriever.rb', line 67

def batches
  @batches
end

#errorsObject (readonly)

Returns the value of attribute errors

Returns:

  • (Object)

    the current value of errors



67
68
69
# File 'app/services/edi/wayfair/catalog_read_v2_retriever.rb', line 67

def errors
  @errors
end

#matchedObject (readonly)

Returns the value of attribute matched

Returns:

  • (Object)

    the current value of matched



67
68
69
# File 'app/services/edi/wayfair/catalog_read_v2_retriever.rb', line 67

def matched
  @matched
end

#requestedObject (readonly)

Returns the value of attribute requested

Returns:

  • (Object)

    the current value of requested



67
68
69
# File 'app/services/edi/wayfair/catalog_read_v2_retriever.rb', line 67

def requested
  @requested
end

#unreturnedObject (readonly)

Returns the value of attribute unreturned

Returns:

  • (Object)

    the current value of unreturned



67
68
69
# File 'app/services/edi/wayfair/catalog_read_v2_retriever.rb', line 67

def unreturned
  @unreturned
end

#updatedObject (readonly)

Returns the value of attribute updated

Returns:

  • (Object)

    the current value of updated



67
68
69
# File 'app/services/edi/wayfair/catalog_read_v2_retriever.rb', line 67

def updated
  @updated
end

Instance Method Details

#to_hHash

Returns tally with unreturned collapsed to its size.

Returns:

  • (Hash)

    tally with unreturned collapsed to its size



78
# File 'app/services/edi/wayfair/catalog_read_v2_retriever.rb', line 78

def to_h = { batches:, requested:, matched:, updated:, unreturned: unreturned.size, errors: }