Sha256: 2baf8ef133bafb2cc70661e130c427d5ff421357bfc2a252d67ef76c86f47d3f

Contents?: true

Size: 530 Bytes

Versions: 6

Compression:

Stored size: 530 Bytes

Contents

module Crags
  module Search
    class Country < Search
      attr_reader :country, :interval

      def initialize(opts = {})
        super
        @country = @opts[:country]
        @interval = @opts[:interval]
      end

      def locations
        country.locations
      end

      def items
        combined_items = locations.collect do |loc|
          sleep(interval)
          search = Location.new(opts.merge(:location => loc))
          search.items
        end
        combined_items.flatten
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
crags-2.2.1 lib/crags/search/country.rb
crags-2.2.0 lib/crags/search/country.rb
crags-2.1.2 lib/crags/search/country.rb
crags-2.1.1 lib/crags/search/country.rb
crags-2.1.0 lib/crags/search/country.rb
crags-2.0.0 lib/crags/search/country.rb