Sha256: d7ced55315707f3aabbf349e1f8702c5ec87e6673b2e1a59248e0d93841b3c60

Contents?: true

Size: 516 Bytes

Versions: 20

Compression:

Stored size: 516 Bytes

Contents

#This module contains class methods used when building up querys on resources. Think index?
module Homeflow
  module API
   class Collection < Array

      def initialize(collection_response, klass)
      	@has_next_page = collection_response["has_next"]
      	@total = collection_response["total"]
         collection_response["elements"].each{|element| self << klass.new(element)}
      end
      

      def has_next_page?
      	@has_next_page
      end

      def total
      	@total
      end
   end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
homeflow_api-1.0.3 lib/homeflow/api/collection.rb
homeflow_api-1.0.2 lib/homeflow/api/collection.rb
homeflow_api-1.0.1 lib/homeflow/api/collection.rb
homeflow_api-1.0.0 lib/homeflow/api/collection.rb
homeflow_api-0.17.15 lib/homeflow/api/collection.rb
homeflow_api-0.17.14 lib/homeflow/api/collection.rb
homeflow_api-0.17.13 lib/homeflow/api/collection.rb
homeflow_api-0.17.12 lib/homeflow/api/collection.rb
homeflow_api-0.17.11 lib/homeflow/api/collection.rb
homeflow_api-0.17.9 lib/homeflow/api/collection.rb
homeflow_api-0.17.8 lib/homeflow/api/collection.rb
homeflow_api-0.17.6 lib/homeflow/api/collection.rb
homeflow_api-0.17.5 lib/homeflow/api/collection.rb
homeflow_api-0.17.4 lib/homeflow/api/collection.rb
homeflow_api-0.17.3 lib/homeflow/api/collection.rb
homeflow_api-0.17.1 lib/homeflow/api/collection.rb
homeflow_api-0.17.0 lib/homeflow/api/collection.rb
homeflow_api-0.16.0 lib/homeflow/api/collection.rb
homeflow_api-0.14.4 lib/homeflow/api/collection.rb
homeflow_api-0.14.3 lib/homeflow/api/collection.rb