Commit 5375430f authored by Mateus Rambo Strey's avatar Mateus Rambo Strey

add limit and offset to items

parent 47f1144a
......@@ -6,7 +6,7 @@ module Dspace
attr_reader :id, :handle, :type, :link, :last_modified, :parent_collection,
:parent_collection_list, :parent_community_list, :bit_streams,
:expand, :metadata
:expand, :limit, :offset, :metadata
def initialize args
@id = args['id']
......@@ -22,6 +22,8 @@ module Dspace
@archived = args['archived']
@withdrawn = args['withdrawn']
@expand = args['expand']
@limit = args['limit']
@offset = args['offset']
@metadata = Dspace::Builders::ModelBuilder.build_metadatas(args['metadata'])
end
......@@ -40,6 +42,8 @@ module Dspace
archived: @archived,
withdrawn: @withdrawn,
expand: @expand,
limit: @limit,
offset: @offset,
metadata: obj2hash(@metadata)
}
end
......@@ -59,4 +63,4 @@ module Dspace
end
end
end
\ No newline at end of file
end
......@@ -6,7 +6,7 @@ module Dspace
default_handler(401) { raise NotAuthorizedError, 'This request requires authentication' }
action :all, 'GET /rest/items' do
query_keys :expand
query_keys :expand, :limit, :offset
handler(200) do |response|
Dspace::Builders::ModelBuilder.build_items(JSON.parse(response.body))
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment