billit_representers 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'billit_representers'
3
- gem.version = '0.2.0'
4
- gem.date = '2013-06-24'
3
+ gem.version = '0.3.0'
4
+ gem.date = '2013-06-25'
5
5
  gem.summary = "Representers for the bill-it module of the Poplus project."
6
6
  gem.description = "Representers for the bill-it module of the Poplus project. These provide object-like access to remote data, using Resource-Oriented Architectures in Ruby (ROAR)."
7
7
  gem.authors = ["Marcel Augsburger"]
@@ -11,5 +11,4 @@ Gem::Specification.new do |gem|
11
11
  gem.files = `git ls-files`.split("\n")
12
12
 
13
13
  gem.add_runtime_dependency "roar"
14
- gem.add_runtime_dependency "roar_generic_pagination_representer"
15
14
  end
@@ -1,18 +1,32 @@
1
1
  require 'roar/representer/json'
2
- require 'roar_generic_pagination_representer/representers/pagination_representer'
3
2
 
4
3
  module Billit
5
4
  module BillCollectionPageRepresenter
6
5
  include Roar::Representer::JSON
7
- include PaginationRepresenter
8
-
6
+ include Roar::Representer::Feature::Hypermedia
7
+
9
8
  collection :items, :extend => BillRepresenter, :class => Bill
10
9
 
10
+ property :total_entries
11
11
  property :current_page
12
12
  property :total_pages
13
-
14
- def page_url(*args)
15
- url_for(args.reduce(args[0]) {|hash, elems| hash.merge(elems)})
16
- end
13
+
14
+ link :self do |params|
15
+ url_for(params.merge(:page => current_page))
16
+ end
17
+
18
+ link :next do |params|
19
+ url_for(params.merge(:page => next_page)) \
20
+ if next_page
21
+ end
22
+
23
+ link :previous do |params|
24
+ url_for(params.merge(:page => previous_page)) \
25
+ if previous_page
26
+ end
27
+
28
+ def items
29
+ self
30
+ end
17
31
  end
18
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: billit_representers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-24 00:00:00.000000000 Z
12
+ date: 2013-06-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: roar
@@ -27,22 +27,6 @@ dependencies:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0'
30
- - !ruby/object:Gem::Dependency
31
- name: roar_generic_pagination_representer
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ! '>='
36
- - !ruby/object:Gem::Version
37
- version: '0'
38
- type: :runtime
39
- prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
46
30
  description: Representers for the bill-it module of the Poplus project. These provide
47
31
  object-like access to remote data, using Resource-Oriented Architectures in Ruby
48
32
  (ROAR).