class SgDeliverySlotChecker::Checker

Attributes

postal_code[R]

Public Class Methods

new(postal_code:) click to toggle source
# File lib/sg_delivery_slot_checker/checker.rb, line 8
def initialize(postal_code:)
  @postal_code = postal_code
end

Public Instance Methods

check_availability() click to toggle source
# File lib/sg_delivery_slot_checker/checker.rb, line 12
def check_availability
  {}.tap do |hash|
    stores.each do |k, v|
      hash[k] = v.new(postal_code: postal_code).available?
    end
  end
end

Private Instance Methods

stores() click to toggle source
# File lib/sg_delivery_slot_checker/checker.rb, line 24
def stores
  {
    fairprice: SgDeliverySlotChecker::Stores::Fairprice,
    giant: SgDeliverySlotChecker::Stores::Giant,
    cold_storage: SgDeliverySlotChecker::Stores::ColdStorage
  }
end