Sha256: ef38fb3e992870a6fa2518dce9f44e9c30364b1de0ac7e38cc8e4d4d7f6bd902

Contents?: true

Size: 602 Bytes

Versions: 1

Compression:

Stored size: 602 Bytes

Contents

require "sg_delivery_slot_checker/stores/fairprice"
require "sg_delivery_slot_checker/stores/giant"

module SgDeliverySlotChecker
  class Checker

    def initialize(postal_code:)
      @postal_code = postal_code
    end

    def check_availability
      {}.tap do |hash|
        stores.each do |k, v|
          hash[k] = v.new(postal_code: postal_code).available?
        end
      end
    end

    private

    attr_reader :postal_code

    def stores
      {
        fairprice: SgDeliverySlotChecker::Stores::Fairprice,
        giant: SgDeliverySlotChecker::Stores::Giant
      }
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sg_delivery_slot_checker-0.1.0 lib/sg_delivery_slot_checker/checker.rb