Sha256: 5b3d0a356c79707df5394235b2053bb8caf93e454da909c4bdb25520e182b8b1

Contents?: true

Size: 586 Bytes

Versions: 16

Compression:

Stored size: 586 Bytes

Contents

module Yaks
  # A collection of Resource objects, it has members, and its own set of link
  # relations like self and profile describing the collection.
  #
  # A collection can be the top-level result of an API call, like all posts to
  # a blog, or a subresource collection, like the comments on a post result.
  #
  class CollectionResource < Resource
    include attributes.add(members: [])

    extend Forwardable
    def_delegators :members, :each, :map, :each_with_object

    # @return [Boolean]
    def collection?
      true
    end

    def seq
      self
    end

  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
yaks-0.9.0 lib/yaks/collection_resource.rb
yaks-0.8.3 lib/yaks/collection_resource.rb
yaks-0.8.2 lib/yaks/collection_resource.rb
yaks-0.8.1 lib/yaks/collection_resource.rb
yaks-0.8.0 lib/yaks/collection_resource.rb
yaks-0.8.0.beta2 lib/yaks/collection_resource.rb
yaks-0.8.0.beta1 lib/yaks/collection_resource.rb
yaks-0.8.0.alpha lib/yaks/collection_resource.rb
yaks-0.7.7 lib/yaks/collection_resource.rb
yaks-0.7.6 lib/yaks/collection_resource.rb
yaks-0.7.5 lib/yaks/collection_resource.rb
yaks-0.7.4 lib/yaks/collection_resource.rb
yaks-0.7.3 lib/yaks/collection_resource.rb
yaks-0.7.2 lib/yaks/collection_resource.rb
yaks-0.7.1 lib/yaks/collection_resource.rb
yaks-0.7.0 lib/yaks/collection_resource.rb