billit_representers 0.5.5 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 411bffe110d7919884e6468e36bc8a165fa342e4
4
- data.tar.gz: 8d38e3c78ce0843f9f6d67e6c1732b63639d7e7a
3
+ metadata.gz: 1f0b7c6960ff39026a266e338ac81862416fc83f
4
+ data.tar.gz: 6f6c64f893cb7653d0e45597f5c88d328f71c017
5
5
  SHA512:
6
- metadata.gz: df6b09fcb6c3e3ed4e94c1083d6413ce441ba223da3b4a615e2f81e8d0010d35df635acb1816c5ef947c2c692b87fc9735199582363af3f0f5f059e08ecb94e1
7
- data.tar.gz: 3c774063dcec94da06ba14a04a117a1363beca87b6332fdcd0be40a36066a942715c9c7847811f2ba39b303a9cc4e00023473b70e9c6935ce1201de945b36ee0
6
+ metadata.gz: 3e12d22b299e1ca5cd0bbf1df33d046f9da4462d12830ee2b39d81b0c359125fa8136fe4f91b9fc1c38e810ffc30ff24c6ebf5cbb22889fa1e83ddb12ca30f66
7
+ data.tar.gz: 0006197e9ca3efaa2188d0522fad1e7be6fa88fc6ac9ce3792407dbf410756da2c461e15d2ff794b391259d9ee6199a3ce87c5274b524dec75e76f1555320541
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'billit_representers'
3
- gem.version = '0.5.5'
4
- gem.date = '2013-12-02'
3
+ gem.version = '0.5.6'
4
+ gem.date = '2013-12-04'
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"]
@@ -0,0 +1,33 @@
1
+ require 'roar/representer/json'
2
+ require 'billit_representers/representers/table_representer'
3
+
4
+ module Billit
5
+ module TableCollectionPageRepresenter
6
+ include Roar::Representer::JSON
7
+ include Roar::Representer::Feature::Hypermedia
8
+
9
+ collection :tables, :extend => TableRepresenter, :class => Table
10
+
11
+ property :total_entries
12
+ property :current_page
13
+ property :total_pages
14
+
15
+ link :self do |params|
16
+ url_for(params.merge(:page => current_page))
17
+ end
18
+
19
+ link :next do |params|
20
+ url_for(params.merge(:page => next_page)) \
21
+ if next_page
22
+ end
23
+
24
+ link :previous do |params|
25
+ url_for(params.merge(:page => previous_page)) \
26
+ if previous_page
27
+ end
28
+
29
+ def tables
30
+ self
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,30 @@
1
+ require 'roar/representer/json'
2
+ require 'billit_representers/representers/table_representer'
3
+
4
+ module Billit
5
+ module TableCollectionRepresenter
6
+ include Roar::Representer::JSON
7
+ include Roar::Representer::Feature::Hypermedia
8
+
9
+ include Roar::Representer::JSON::HAL
10
+
11
+ module Initializer
12
+ def initialize
13
+ extend Billit::TableCollectionRepresenter
14
+ extend Roar::Representer::Feature::Client
15
+ super
16
+ end
17
+ end
18
+
19
+ def self.included(klass)
20
+ klass.send :prepend, Initializer
21
+ klass.send :include, Roar::Representer::Feature::HttpVerbs
22
+ end
23
+
24
+ collection :tables, :extend => TableRepresenter, :class => Table
25
+
26
+ def tables
27
+ collect
28
+ end
29
+ end
30
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: billit_representers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcel Augsburger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-02 00:00:00.000000000 Z
11
+ date: 2013-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: roar
@@ -54,6 +54,8 @@ files:
54
54
  - lib/billit_representers/representers/bill_collection_page_representer.rb
55
55
  - lib/billit_representers/representers/bill_collection_representer.rb
56
56
  - lib/billit_representers/representers/bill_representer.rb
57
+ - lib/billit_representers/representers/table_collection_page_representer.rb
58
+ - lib/billit_representers/representers/table_collection_representer.rb
57
59
  - lib/billit_representers/representers/table_representer.rb
58
60
  homepage: https://github.com/ciudadanointeligente/billit_representers
59
61
  licenses: