Class: Bing::Content::Api::Response
- Inherits:
-
Object
- Object
- Bing::Content::Api::Response
- Defined in:
- lib/bing/content/api/response.rb
Instance Attribute Summary collapse
-
#failures ⇒ Object
readonly
Returns the value of attribute failures.
-
#successes ⇒ Object
readonly
Returns the value of attribute successes.
Instance Method Summary collapse
-
#initialize(response_entries, batch) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(response_entries, batch) ⇒ Response
Returns a new instance of Response.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/bing/content/api/response.rb', line 7 def initialize(response_entries, batch) @failures = [] @successes = [] response_entries.each do |entry| id = entry["batchId"].to_i error = entry["errors"] if error failures << { response: entry, product: batch.product_by_batch_id(id) } else successes << { response: entry, product: batch.product_by_batch_id(id) } end end end |
Instance Attribute Details
#failures ⇒ Object (readonly)
Returns the value of attribute failures.
5 6 7 |
# File 'lib/bing/content/api/response.rb', line 5 def failures @failures end |
#successes ⇒ Object (readonly)
Returns the value of attribute successes.
5 6 7 |
# File 'lib/bing/content/api/response.rb', line 5 def successes @successes end |