billit_representers 0.9.5 → 0.9.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: 0164e56cf9dfcea9b32054c2f7cc897a477897a4
4
- data.tar.gz: 499908ef0d51cdd9cbf43eeb31150511cbd60e2c
3
+ metadata.gz: a09ee6d4780689cac4638e9163ce7308c0dc50ff
4
+ data.tar.gz: 8c58385e119cee7cdee2bca872489be362009085
5
5
  SHA512:
6
- metadata.gz: f1c55a078792f5b459c95ff06daaa7dcb8454d19ea0c3f8ad510205e0bced99239a00b5180161f5e740c9b9e128acf9e465e2522dca91abd0abe3fdcd2877e1d
7
- data.tar.gz: 8a6102ff3a8c9317d0f9323ceb92124c4bde6855053f989b7ac58bac797437e1e9e8a108a5da5aa2181368d0762ba4376e7823ef596632e3842b4ec2fa56757a
6
+ metadata.gz: 18b91e80258b901fa8ee38a0b48e75796567ff81cc531d4bdad0b8d5408bbd29a391cc25e5d982f2670591027420a5fd22882a442bf9d8e04cb20bfc4326d913
7
+ data.tar.gz: 7c35778127b41da7c158ef05b5fd0e67e23f6632d15c2256d447c5ea910f23d7deeccaf655b36c7ac60abc9e977617fc657de71da90573df5d69464c9a910882
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'billit_representers'
3
- gem.version = '0.9.5'
4
- gem.date = '2014-05-15'
3
+ gem.version = '0.9.6'
4
+ gem.date = '2014-06-13'
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,7 +11,6 @@ Gem::Specification.new do |gem|
11
11
 
12
12
  gem.files = `git ls-files`.split("\n")
13
13
 
14
- # gem.add_runtime_dependency "roar", "0.12.2"
15
14
  gem.add_runtime_dependency "roar", "0.11.19"
16
15
  gem.add_runtime_dependency "roar-rails", "0.1.0"
17
16
  gem.add_runtime_dependency "activemodel"
@@ -0,0 +1,4 @@
1
+ require 'billit_representers/representers/count_representer'
2
+ class BillitCount
3
+ include Billit::CountRepresenter
4
+ end
@@ -0,0 +1,8 @@
1
+ require 'billit_representers/representers/motion_representer'
2
+ class BillitMotion
3
+ include Billit::MotionRepresenter
4
+
5
+ def self_link
6
+ links[:self].href if links[:self]
7
+ end
8
+ end
@@ -0,0 +1,4 @@
1
+ require 'billit_representers/representers/vote_representer'
2
+ class BillitVote
3
+ include Billit::VoteRepresenter
4
+ end
@@ -0,0 +1,4 @@
1
+ require 'billit_representers/representers/vote_event_representer'
2
+ class BillitVoteEvent
3
+ include Billit::VoteEventRepresenter
4
+ end
@@ -12,6 +12,7 @@ require 'billit_representers/representers/document_representer'
12
12
  require 'billit_representers/representers/directive_representer'
13
13
  require 'billit_representers/representers/remark_representer'
14
14
  require 'billit_representers/representers/revision_representer'
15
+ require 'billit_representers/representers/motion_representer'
15
16
  require 'billit_representers/models/paperwork'
16
17
  require 'billit_representers/models/priority'
17
18
  require 'billit_representers/models/report'
@@ -19,6 +20,7 @@ require 'billit_representers/models/document'
19
20
  require 'billit_representers/models/directive'
20
21
  require 'billit_representers/models/remark'
21
22
  require 'billit_representers/models/revision'
23
+ require 'billit_representers/models/motion'
22
24
 
23
25
  module Billit
24
26
  module BillRepresenter
@@ -72,6 +74,7 @@ module Billit
72
74
  collection :directives, extend: Billit::DirectiveRepresenter, class: lambda { |x, *| Object.const_defined?("Directive") ? Directive : BillitDirective }, parse_strategy: :sync
73
75
  collection :remarks, extend: Billit::RemarkRepresenter, class: lambda { |x, *| Object.const_defined?("Remark") ? Remark : BillitRemark }, parse_strategy: :sync
74
76
  collection :revisions, extend: Billit::RevisionRepresenter, class: lambda { |x, *| Object.const_defined?("Revision") ? Revision : BillitRevision }, parse_strategy: :sync
77
+ collection :motions, extend: Billit::MotionRepresenter, class: lambda { |x, *| Object.const_defined?("Motion") ? Motion : BillitMotion }, parse_strategy: :sync
75
78
 
76
79
  link :self do
77
80
  bill_url(self.uid)
@@ -0,0 +1,28 @@
1
+ require 'roar/representer'
2
+ require 'roar/representer/feature/http_verbs'
3
+ require 'roar/representer/feature/client'
4
+ require 'roar/representer/json'
5
+ require 'roar/representer/json/hal'
6
+ # require 'roar/rails/hal'
7
+
8
+ module Billit
9
+ module CountRepresenter
10
+ include Roar::Representer::JSON::HAL
11
+
12
+ module Initializer
13
+ def initialize
14
+ extend Billit::CountRepresenter
15
+ extend Roar::Representer::Feature::Client
16
+ super
17
+ end
18
+ end
19
+
20
+ def self.included(klass)
21
+ klass.send :prepend, Initializer
22
+ klass.send :include, Roar::Representer::Feature::HttpVerbs
23
+ end
24
+
25
+ property :option
26
+ property :value
27
+ end
28
+ end
@@ -0,0 +1,44 @@
1
+ require 'roar/representer'
2
+ require 'roar/representer/feature/http_verbs'
3
+ require 'roar/representer/feature/client'
4
+ require 'roar/representer/json'
5
+ require 'roar/representer/json/hal'
6
+ # require 'roar/rails/hal'
7
+ require 'billit_representers/representers/vote_event_representer'
8
+ require 'billit_representers/representers/count_representer'
9
+ require 'billit_representers/models/vote_event'
10
+ require 'billit_representers/models/count'
11
+
12
+ module Billit
13
+ module MotionRepresenter
14
+ include Roar::Representer::JSON::HAL
15
+
16
+ module Initializer
17
+ def initialize
18
+ extend Billit::MotionRepresenter
19
+ extend Roar::Representer::Feature::Client
20
+ super
21
+ end
22
+ end
23
+
24
+ def self.included(klass)
25
+ klass.send :prepend, Initializer
26
+ klass.send :include, Roar::Representer::Feature::HttpVerbs
27
+ end
28
+
29
+ property :organization
30
+ property :context
31
+ property :creator
32
+ property :text
33
+ property :date
34
+ property :requirement
35
+ property :result
36
+ property :session
37
+
38
+ collection :vote_events, extend: Billit::VoteEventRepresenter, class: lambda { |x, *| Object.const_defined?("VoteEvent") ? VoteEvent : BillitVoteEvent }, parse_strategy: :sync
39
+
40
+ link :self do
41
+ motion_url(self.id)
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,35 @@
1
+ require 'roar/representer'
2
+ require 'roar/representer/feature/http_verbs'
3
+ require 'roar/representer/feature/client'
4
+ require 'roar/representer/json'
5
+ require 'roar/representer/json/hal'
6
+ # require 'roar/rails/hal'
7
+ require 'billit_representers/representers/count_representer'
8
+ require 'billit_representers/representers/vote_representer'
9
+ require 'billit_representers/models/count'
10
+ require 'billit_representers/models/vote'
11
+
12
+ module Billit
13
+ module VoteEventRepresenter
14
+ include Roar::Representer::JSON::HAL
15
+
16
+ module Initializer
17
+ def initialize
18
+ extend Billit::VoteEventRepresenter
19
+ extend Roar::Representer::Feature::Client
20
+ super
21
+ end
22
+ end
23
+
24
+ def self.included(klass)
25
+ klass.send :prepend, Initializer
26
+ klass.send :include, Roar::Representer::Feature::HttpVerbs
27
+ end
28
+
29
+ property :start_date
30
+ property :end_date
31
+
32
+ collection :counts, extend: Billit::CountRepresenter, class: lambda { |x, *| Object.const_defined?("Count") ? Count : BillitCount }, parse_strategy: :sync
33
+ collection :votes, extend: Billit::VoteRepresenter, class: lambda { |x, *| Object.const_defined?("Vote") ? Vote : BillitVote }, parse_strategy: :sync
34
+ end
35
+ end
@@ -0,0 +1,28 @@
1
+ require 'roar/representer'
2
+ require 'roar/representer/feature/http_verbs'
3
+ require 'roar/representer/feature/client'
4
+ require 'roar/representer/json'
5
+ require 'roar/representer/json/hal'
6
+ # require 'roar/rails/hal'
7
+
8
+ module Billit
9
+ module VoteRepresenter
10
+ include Roar::Representer::JSON::HAL
11
+
12
+ module Initializer
13
+ def initialize
14
+ extend Billit::VoteRepresenter
15
+ extend Roar::Representer::Feature::Client
16
+ super
17
+ end
18
+ end
19
+
20
+ def self.included(klass)
21
+ klass.send :prepend, Initializer
22
+ klass.send :include, Roar::Representer::Feature::HttpVerbs
23
+ end
24
+
25
+ property :voter_id
26
+ property :option
27
+ end
28
+ 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.9.5
4
+ version: 0.9.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: 2014-05-15 00:00:00.000000000 Z
11
+ date: 2014-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: roar
@@ -68,19 +68,25 @@ files:
68
68
  - lib/billit_representers/models/bill.rb
69
69
  - lib/billit_representers/models/bill_basic.rb
70
70
  - lib/billit_representers/models/bill_page.rb
71
+ - lib/billit_representers/models/count.rb
71
72
  - lib/billit_representers/models/directive.rb
72
73
  - lib/billit_representers/models/document.rb
74
+ - lib/billit_representers/models/motion.rb
73
75
  - lib/billit_representers/models/paperwork.rb
74
76
  - lib/billit_representers/models/paperwork_collection.rb
75
77
  - lib/billit_representers/models/priority.rb
76
78
  - lib/billit_representers/models/remark.rb
77
79
  - lib/billit_representers/models/report.rb
78
80
  - lib/billit_representers/models/revision.rb
81
+ - lib/billit_representers/models/vote.rb
82
+ - lib/billit_representers/models/vote_event.rb
79
83
  - lib/billit_representers/representers/bill_basic_representer.rb
80
84
  - lib/billit_representers/representers/bill_page_representer.rb
81
85
  - lib/billit_representers/representers/bill_representer.rb
86
+ - lib/billit_representers/representers/count_representer.rb
82
87
  - lib/billit_representers/representers/directive_representer.rb
83
88
  - lib/billit_representers/representers/document_representer.rb
89
+ - lib/billit_representers/representers/motion_representer.rb
84
90
  - lib/billit_representers/representers/paperwork_collection_representer.rb
85
91
  - lib/billit_representers/representers/paperwork_representer.rb
86
92
  - lib/billit_representers/representers/priority_representer.rb
@@ -90,6 +96,8 @@ files:
90
96
  - lib/billit_representers/representers/table_collection_page_representer.rb
91
97
  - lib/billit_representers/representers/table_collection_representer.rb
92
98
  - lib/billit_representers/representers/table_representer.rb
99
+ - lib/billit_representers/representers/vote_event_representer.rb
100
+ - lib/billit_representers/representers/vote_representer.rb
93
101
  homepage: https://github.com/ciudadanointeligente/billit_representers
94
102
  licenses:
95
103
  - GPL-3