Sha256: 5e20e32614e9388985b6c9346ae945e5e1127fd4e917e4518d0b22e1cd9061ad

Contents?: true

Size: 365 Bytes

Versions: 10

Compression:

Stored size: 365 Bytes

Contents

# frozen_string_literal: true

module Alma
  class LocationSet < ResultSet
    def_delegators :results, :[], :empty?

    def each(&block)
      results.each(&block)
    end

    def results
      @results ||= @response.fetch(key, [])
        .map { |item| single_record_class.new(item) }
    end

    protected
      def key
        "location"
      end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
alma-0.6.2 lib/alma/location_set.rb
alma-0.6.1 lib/alma/location_set.rb
alma-0.6.0 lib/alma/location_set.rb
alma-0.5.1 lib/alma/location_set.rb
alma-0.5.0 lib/alma/location_set.rb
alma-0.4.2 lib/alma/location_set.rb
alma-0.4.1 lib/alma/location_set.rb
alma-0.4.0 lib/alma/location_set.rb
alma-0.3.3 lib/alma/location_set.rb
alma-0.3.2 lib/alma/location_set.rb