Class: Retailer::SiblingPriceRefresher::Result

Inherits:
Data
  • Object
show all
Defined in:
app/services/retailer/sibling_price_refresher.rb

Overview

Service object: result.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(refreshed_count: nil, lowest_price: nil, prices: nil, errors: nil) ⇒ Result

Returns a new instance of Result.



21
# File 'app/services/retailer/sibling_price_refresher.rb', line 21

def initialize(refreshed_count: nil, lowest_price: nil, prices: nil, errors: nil) = super

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors

Returns:

  • (Object)

    the current value of errors



20
21
22
# File 'app/services/retailer/sibling_price_refresher.rb', line 20

def errors
  @errors
end

#lowest_priceObject (readonly)

Returns the value of attribute lowest_price

Returns:

  • (Object)

    the current value of lowest_price



20
21
22
# File 'app/services/retailer/sibling_price_refresher.rb', line 20

def lowest_price
  @lowest_price
end

#pricesObject (readonly)

Returns the value of attribute prices

Returns:

  • (Object)

    the current value of prices



20
21
22
# File 'app/services/retailer/sibling_price_refresher.rb', line 20

def prices
  @prices
end

#refreshed_countObject (readonly)

Returns the value of attribute refreshed_count

Returns:

  • (Object)

    the current value of refreshed_count



20
21
22
# File 'app/services/retailer/sibling_price_refresher.rb', line 20

def refreshed_count
  @refreshed_count
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'app/services/retailer/sibling_price_refresher.rb', line 23

def success?
  errors.empty?
end