Class: Retailer::WalmartItemIdDiscovery::Result
- Inherits:
-
Data
- Object
- Data
- Retailer::WalmartItemIdDiscovery::Result
- Defined in:
- app/services/retailer/walmart_item_id_discovery.rb
Instance Attribute Summary collapse
-
#already_set ⇒ Object
readonly
Returns the value of attribute already_set.
-
#conflicts ⇒ Object
readonly
Returns the value of attribute conflicts.
-
#dry_run ⇒ Object
readonly
Returns the value of attribute dry_run.
-
#unlisted ⇒ Object
readonly
Returns the value of attribute unlisted.
-
#updated ⇒ Object
readonly
Returns the value of attribute updated.
Instance Method Summary collapse
Instance Attribute Details
#already_set ⇒ Object (readonly)
Returns the value of attribute already_set
36 37 38 |
# File 'app/services/retailer/walmart_item_id_discovery.rb', line 36 def already_set @already_set end |
#conflicts ⇒ Object (readonly)
Returns the value of attribute conflicts
36 37 38 |
# File 'app/services/retailer/walmart_item_id_discovery.rb', line 36 def conflicts @conflicts end |
#dry_run ⇒ Object (readonly)
Returns the value of attribute dry_run
36 37 38 |
# File 'app/services/retailer/walmart_item_id_discovery.rb', line 36 def dry_run @dry_run end |
#unlisted ⇒ Object (readonly)
Returns the value of attribute unlisted
36 37 38 |
# File 'app/services/retailer/walmart_item_id_discovery.rb', line 36 def unlisted @unlisted end |
#updated ⇒ Object (readonly)
Returns the value of attribute updated
36 37 38 |
# File 'app/services/retailer/walmart_item_id_discovery.rb', line 36 def updated @updated end |
Instance Method Details
#report ⇒ Object
37 38 39 40 41 42 43 44 45 |
# File 'app/services/retailer/walmart_item_id_discovery.rb', line 37 def report lines = ["#{'[DRY RUN] ' if dry_run}Walmart item ids: #{updated.size} to set, " \ "#{already_set} already set, #{unlisted.size} not listed by Walmart, #{conflicts.size} UPC conflicts"] lines << "\nNot listed by Walmart (listing problem, not a URL problem):" if unlisted.any? unlisted.sort.each { |sku| lines << " #{sku}" } lines << "\nUPC CONFLICTS — not written, investigate:" if conflicts.any? conflicts.each { |c| lines << " #{c[:sku]}: ours=#{c[:ours]} walmart=#{c[:theirs]}" } lines.join("\n") end |