lib/shamu/entities/list.rb in shamu-0.0.13 vs lib/shamu/entities/list.rb in shamu-0.0.14
- old
+ new
@@ -14,15 +14,21 @@
# Enumerate through each of the entities in the list.
def each( &block )
entities.each( &block )
end
- delegate :first, :count, :empty?, to: :raw_entities
+ delegate :first, :last, :count, :empty?, :index, to: :raw_entities
alias_method :size, :count
alias_method :length, :count
+ # @return [Boolean] true if the list represents a slice of a larger set.
+ # See {PagedList} for paged implementation.
+ def paged?
+ false
+ end
+
# Get an entity by it's primary key.
# @param [Object] key the primary key to look for.
# @param [Symbol] field to use as the primary key. Default :id.
# @return [Entities::Entity] the found entity.
# @raise [Shamu::NotFoundError] if the entity cannot be found.
@@ -49,6 +55,6 @@
def key_attribute
:id
end
end
end
-end
\ No newline at end of file
+end