Sha256: 15c1603273d9a6f09e4cea62d38794211c284baedadd79087c31e666b1a75953

Contents?: true

Size: 390 Bytes

Versions: 1

Compression:

Stored size: 390 Bytes

Contents

module PGit
  module Pivotal
    class CollectionRequest < Pivotal::Request
      def get!
        hashes_of_items.map do |item_hash|
          individual.new {|iter| iter.hash = item_hash}
        end
      end

      private

      def individual
        self.class.to_s[0...-1].constantize
      end

      def hashes_of_items
        JSON.parse(get_request)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pgit-1.0.0 lib/pgit/pivotal/collection_request.rb