billit_representers 0.9.10 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/billit_representers.gemspec +3 -2
  3. data/lib/billit_representers/models/cl/bill.rb +26 -0
  4. data/lib/billit_representers/models/cl/bill_basic.rb +26 -0
  5. data/lib/billit_representers/models/cl/bill_page.rb +20 -0
  6. data/lib/billit_representers/models/cl/directive.rb +8 -0
  7. data/lib/billit_representers/models/cl/document.rb +8 -0
  8. data/lib/billit_representers/models/cl/paperwork.rb +8 -0
  9. data/lib/billit_representers/models/cl/paperwork_page.rb +8 -0
  10. data/lib/billit_representers/models/cl/priority.rb +8 -0
  11. data/lib/billit_representers/models/cl/remark.rb +8 -0
  12. data/lib/billit_representers/models/cl/report.rb +8 -0
  13. data/lib/billit_representers/models/cl/revision.rb +8 -0
  14. data/lib/billit_representers/representers/bill_page_representer.rb +3 -3
  15. data/lib/billit_representers/representers/bill_representer.rb +6 -119
  16. data/lib/billit_representers/representers/cl/bill_basic_representer.rb +140 -0
  17. data/lib/billit_representers/representers/cl/bill_page_representer.rb +50 -0
  18. data/lib/billit_representers/representers/cl/bill_representer.rb +162 -0
  19. data/lib/billit_representers/representers/cl/directive_representer.rb +34 -0
  20. data/lib/billit_representers/representers/cl/document_representer.rb +37 -0
  21. data/lib/billit_representers/representers/cl/paperwork_page_representer.rb +32 -0
  22. data/lib/billit_representers/representers/cl/paperwork_representer.rb +62 -0
  23. data/lib/billit_representers/representers/cl/priority_representer.rb +37 -0
  24. data/lib/billit_representers/representers/cl/remark_representer.rb +33 -0
  25. data/lib/billit_representers/representers/cl/report_representer.rb +34 -0
  26. data/lib/billit_representers/representers/cl/revision_representer.rb +31 -0
  27. data/lib/billit_representers/representers/cl/table_page_representer.rb +35 -0
  28. data/lib/billit_representers/representers/cl/table_representer.rb +37 -0
  29. metadata +27 -34
  30. data/lib/billit_representers/models/bill_basic.rb +0 -24
  31. data/lib/billit_representers/models/bill_update.rb +0 -6
  32. data/lib/billit_representers/models/count.rb +0 -4
  33. data/lib/billit_representers/models/directive.rb +0 -4
  34. data/lib/billit_representers/models/document.rb +0 -4
  35. data/lib/billit_representers/models/motion.rb +0 -8
  36. data/lib/billit_representers/models/paperwork.rb +0 -4
  37. data/lib/billit_representers/models/paperwork_collection.rb +0 -4
  38. data/lib/billit_representers/models/priority.rb +0 -4
  39. data/lib/billit_representers/models/remark.rb +0 -4
  40. data/lib/billit_representers/models/report.rb +0 -4
  41. data/lib/billit_representers/models/revision.rb +0 -4
  42. data/lib/billit_representers/models/vote.rb +0 -4
  43. data/lib/billit_representers/models/vote_event.rb +0 -4
  44. data/lib/billit_representers/representers/bill_basic_representer.rb +0 -138
  45. data/lib/billit_representers/representers/bill_update_representer.rb +0 -145
  46. data/lib/billit_representers/representers/count_representer.rb +0 -28
  47. data/lib/billit_representers/representers/directive_representer.rb +0 -32
  48. data/lib/billit_representers/representers/document_representer.rb +0 -35
  49. data/lib/billit_representers/representers/motion_representer.rb +0 -44
  50. data/lib/billit_representers/representers/paperwork_collection_representer.rb +0 -29
  51. data/lib/billit_representers/representers/paperwork_representer.rb +0 -60
  52. data/lib/billit_representers/representers/priority_representer.rb +0 -35
  53. data/lib/billit_representers/representers/remark_representer.rb +0 -31
  54. data/lib/billit_representers/representers/report_representer.rb +0 -32
  55. data/lib/billit_representers/representers/revision_representer.rb +0 -29
  56. data/lib/billit_representers/representers/table_collection_page_representer.rb +0 -33
  57. data/lib/billit_representers/representers/table_collection_representer.rb +0 -30
  58. data/lib/billit_representers/representers/table_representer.rb +0 -35
  59. data/lib/billit_representers/representers/vote_event_representer.rb +0 -35
  60. data/lib/billit_representers/representers/vote_representer.rb +0 -28
@@ -1,32 +0,0 @@
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/rails/hal'
6
- require 'roar/representer/json/hal'
7
-
8
- module Billit
9
- module ReportRepresenter
10
- include Roar::Representer::JSON::HAL
11
- # include Roar::Representer::JSON
12
-
13
- module Initializer
14
- def initialize
15
- extend Billit::ReportRepresenter
16
- extend Roar::Representer::Feature::Client
17
- super
18
- end
19
- end
20
-
21
- def self.included(klass)
22
- klass.send :prepend, Initializer
23
- klass.send :include, Roar::Representer::Feature::HttpVerbs
24
- end
25
-
26
- property :date
27
- property :step
28
- property :stage
29
- property :link
30
-
31
- end
32
- end
@@ -1,29 +0,0 @@
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/rails/hal'
6
- require 'roar/representer/json/hal'
7
-
8
- module Billit
9
- module RevisionRepresenter
10
- include Roar::Representer::JSON::HAL
11
- # include Roar::Representer::JSON
12
-
13
- module Initializer
14
- def initialize
15
- extend Billit::RevisionRepresenter
16
- extend Roar::Representer::Feature::Client
17
- super
18
- end
19
- end
20
-
21
- def self.included(klass)
22
- klass.send :prepend, Initializer
23
- klass.send :include, Roar::Representer::Feature::HttpVerbs
24
- end
25
-
26
- property :description
27
- property :link
28
- end
29
- end
@@ -1,33 +0,0 @@
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
@@ -1,30 +0,0 @@
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
@@ -1,35 +0,0 @@
1
- require 'roar/representer/feature/hypermedia'
2
- require 'roar/representer/feature/http_verbs'
3
- require 'roar/representer/feature/client'
4
- require 'active_model'
5
-
6
- module Billit
7
- module TableRepresenter
8
- include Roar::Representer::JSON::HAL
9
-
10
- module Initializer
11
- def initialize
12
- extend Billit::TableRepresenter
13
- extend Roar::Representer::Feature::Client
14
- super
15
- end
16
- end
17
-
18
- def self.included(klass)
19
- klass.send :prepend, Initializer
20
- klass.send :include, Roar::Representer::Feature::HttpVerbs
21
- end
22
-
23
- property :uid
24
- property :initial_chamber
25
- property :creation_date
26
- property :legislature
27
- property :session
28
- property :bills
29
-
30
-
31
- link :self do
32
- bill_url(self.uid)
33
- end
34
- end
35
- end
@@ -1,35 +0,0 @@
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 }
33
- collection :votes, extend: Billit::VoteRepresenter, class: lambda { |x, *| Object.const_defined?("Vote") ? Vote : BillitVote }
34
- end
35
- end
@@ -1,28 +0,0 @@
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