billit_representers 0.8.12 → 0.9.0

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: 9f555ee664313c79f311962dd8c8ad66ba6a8752
4
- data.tar.gz: 0b374ddd9ee93d68d4c952cf1dc665994fea3ee7
3
+ metadata.gz: 9ad313075bd4af21d2a1f2c995ddeb608cd9f4a7
4
+ data.tar.gz: db586b4052f594a86cebd02826610cca4516f383
5
5
  SHA512:
6
- metadata.gz: 281ed2b881fc44cf1d416008d064d6f72de0f292f7bf1d65abe0fb1b2957647bcfbdcc6bcb04df6eef1e5259f72f48561038df8d93a669a637e716d04e679cf3
7
- data.tar.gz: b2fde6dc4710b24101ad1f3eee667f3a463301546152406f70e454c3a80788107652d5d6abe24f52fa80513cc7685092988f6bca799525ae22e4d69f0de3fd1a
6
+ metadata.gz: fb1f83f13ff34b77cbe761f5d6c7641c6475fb4946d545c2bcae290fa40e2ecc7a21d265fe3e5d9ea463ed0e41b0b3a1837541d615375bbac5b43c206af99b42
7
+ data.tar.gz: 0b2a40a2137e3c7e60386222b6601f7bf6f30f91e37be82465607a1945f04392e3bb327650452b63b0b912f1c541a625b0ba591abd801ecfef1f7a757f8acfaa
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'billit_representers'
3
- gem.version = '0.8.12'
4
- gem.date = '2014-03-19'
3
+ gem.version = '0.9.0'
4
+ gem.date = '2014-03-21'
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"]
@@ -1,7 +1,7 @@
1
- require 'billit_representers/representers/bill_model_representer'
1
+ require 'billit_representers/representers/bill_representer'
2
2
  module Billit
3
3
  class Bill
4
- include Billit::BillModelRepresenter
4
+ include Billit::BillRepresenter
5
5
 
6
6
  attr_reader :representable_attrs
7
7
 
@@ -1,7 +1,7 @@
1
- require 'billit_representers/representers/bill_model_representer'
1
+ require 'billit_representers/representers/bill_basic_representer'
2
2
  module Billit
3
3
  class BillBasic
4
- include Billit::BillBasicModelRepresenter
4
+ include Billit::BillBasicRepresenter
5
5
 
6
6
  attr_reader :representable_attrs
7
7
 
@@ -1,7 +1,7 @@
1
- require 'billit_representers/representers/bill_model_collection_page_representer'
1
+ require 'billit_representers/representers/bill_page_representer'
2
2
  module Billit
3
- class BillCollectionPage
4
- include Billit::BillModelCollectionPageRepresenter
3
+ class BillPage
4
+ include Billit::BillPageRepresenter
5
5
 
6
6
  def self
7
7
  links[:self].href if links[:self]
@@ -7,14 +7,14 @@ require 'roar/representer/json/hal'
7
7
  require 'active_model'
8
8
 
9
9
  module Billit
10
- module BillBasicModelRepresenter
10
+ module BillBasicRepresenter
11
11
  include Roar::Representer::JSON::HAL
12
12
  # include Roar::Rails::HAL
13
13
  # include Roar::Representer::JSON
14
14
 
15
15
  module Initializer
16
16
  def initialize
17
- extend Billit::BillBasicModelRepresenter
17
+ extend Billit::BillBasicRepresenter
18
18
  extend Roar::Representer::Feature::Client
19
19
  super
20
20
  end
@@ -1,16 +1,16 @@
1
1
  require 'roar/representer/json'
2
- require 'billit_representers/models/bill'
3
- require 'billit_representers/representers/bill_representer'
2
+ require 'billit_representers/models/bill_basic'
3
+ require 'billit_representers/representers/bill_basic_representer'
4
4
 
5
5
  module Billit
6
- module BillModelCollectionPageRepresenter
6
+ module BillPageRepresenter
7
7
 
8
8
  include Roar::Representer::JSON
9
9
  include Roar::Representer::Feature::Hypermedia
10
10
 
11
11
  module Initializer
12
12
  def initialize
13
- extend Billit::BillModelCollectionPageRepresenter
13
+ extend Billit::BillPageRepresenter
14
14
  extend Roar::Representer::Feature::Client
15
15
  super
16
16
  end
@@ -21,7 +21,7 @@ module Billit
21
21
  klass.send :include, Roar::Representer::Feature::HttpVerbs
22
22
  end
23
23
 
24
- collection :bills, :extend => Billit::BillModelRepresenter, :class => Billit::Bill
24
+ collection :bills, :extend => Billit::BillBasicRepresenter, :class => Billit::BillBasic
25
25
 
26
26
  property :total_entries
27
27
  property :current_page
@@ -1,7 +1,7 @@
1
1
  require 'roar/representer'
2
2
  require 'roar/representer/feature/http_verbs'
3
3
  require 'roar/representer/feature/client'
4
- # require 'roar/representer/json'
4
+ require 'roar/representer/json'
5
5
  require 'roar/representer/json/hal'
6
6
  # require 'roar/rails/hal'
7
7
  require 'active_model'
@@ -12,6 +12,13 @@ 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/models/paperwork'
16
+ require 'billit_representers/models/priority'
17
+ require 'billit_representers/models/report'
18
+ require 'billit_representers/models/document'
19
+ require 'billit_representers/models/directive'
20
+ require 'billit_representers/models/remark'
21
+ require 'billit_representers/models/revision'
15
22
 
16
23
  module Billit
17
24
  module BillRepresenter
@@ -57,13 +64,13 @@ module Billit
57
64
  property :abstract
58
65
  property :tags
59
66
 
60
- collection :paperworks, extend: PaperworkRepresenter, class: Paperwork, parse_strategy: :sync
61
- collection :priorities, extend: PriorityRepresenter, class: Priority, parse_strategy: :sync
62
- collection :reports, extend: ReportRepresenter, class: Report, parse_strategy: :sync
63
- collection :documents, extend: DocumentRepresenter, class: Document, parse_strategy: :sync
64
- collection :directives, extend: DirectiveRepresenter, class: Directive, parse_strategy: :sync
65
- collection :remarks, extend: RemarkRepresenter, class: Remark, parse_strategy: :sync
66
- collection :revisions, extend: RevisionRepresenter, class: Revision, parse_strategy: :sync
67
+ collection :paperworks, extend: Billit::PaperworkRepresenter, class: Billit::Paperwork, parse_strategy: :sync
68
+ collection :priorities, extend: Billit::PriorityRepresenter, class: Billit::Priority, parse_strategy: :sync
69
+ collection :reports, extend: Billit::ReportRepresenter, class: Billit::Report, parse_strategy: :sync
70
+ collection :documents, extend: Billit::DocumentRepresenter, class: Billit::Document, parse_strategy: :sync
71
+ collection :directives, extend: Billit::DirectiveRepresenter, class: Billit::Directive, parse_strategy: :sync
72
+ collection :remarks, extend: Billit::RemarkRepresenter, class: Billit::Remark, parse_strategy: :sync
73
+ collection :revisions, extend: Billit::RevisionRepresenter, class: Billit::Revision, parse_strategy: :sync
67
74
 
68
75
  link :self do
69
76
  bill_url(self.uid)
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.8.12
4
+ version: 0.9.0
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-03-19 00:00:00.000000000 Z
11
+ date: 2014-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: roar
@@ -76,11 +76,8 @@ files:
76
76
  - lib/billit_representers/models/remark.rb
77
77
  - lib/billit_representers/models/report.rb
78
78
  - lib/billit_representers/models/revision.rb
79
- - lib/billit_representers/representers/bill_basic_model_representer.rb
80
- - lib/billit_representers/representers/bill_collection_page_representer.rb
81
- - lib/billit_representers/representers/bill_collection_representer.rb
82
- - lib/billit_representers/representers/bill_model_collection_page_representer.rb
83
- - lib/billit_representers/representers/bill_model_representer.rb
79
+ - lib/billit_representers/representers/bill_basic_representer.rb
80
+ - lib/billit_representers/representers/bill_page_representer.rb
84
81
  - lib/billit_representers/representers/bill_representer.rb
85
82
  - lib/billit_representers/representers/directive_representer.rb
86
83
  - lib/billit_representers/representers/document_representer.rb
@@ -1,33 +0,0 @@
1
- require 'roar/representer/json'
2
- require 'billit_representers/representers/bill_representer'
3
-
4
- module Billit
5
- module BillCollectionPageRepresenter
6
- include Roar::Representer::JSON
7
- include Roar::Representer::Feature::Hypermedia
8
-
9
- collection :bills, :extend => BillRepresenter, :class => Bill
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 bills
30
- self
31
- end
32
- end
33
- end
@@ -1,16 +0,0 @@
1
- require 'roar/representer/json'
2
- require 'billit_representers/representers/bill_representer'
3
-
4
-
5
- module Billit
6
- module BillCollectionRepresenter
7
- include Roar::Representer::JSON
8
- include Roar::Representer::Feature::Hypermedia
9
-
10
- collection :bills, :extend => BillRepresenter, :class => Bill
11
-
12
- def bills
13
- collect
14
- end
15
- end
16
- end
@@ -1,160 +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 'active_model'
8
- require 'billit_representers/representers/paperwork_representer'
9
- require 'billit_representers/representers/priority_representer'
10
- require 'billit_representers/representers/report_representer'
11
- require 'billit_representers/representers/document_representer'
12
- require 'billit_representers/representers/directive_representer'
13
- require 'billit_representers/representers/remark_representer'
14
- require 'billit_representers/representers/revision_representer'
15
- require 'billit_representers/models/paperwork'
16
- require 'billit_representers/models/priority'
17
- require 'billit_representers/models/report'
18
- require 'billit_representers/models/document'
19
- require 'billit_representers/models/directive'
20
- require 'billit_representers/models/remark'
21
- require 'billit_representers/models/revision'
22
-
23
- module Billit
24
- module BillModelRepresenter
25
- include Roar::Representer::JSON::HAL
26
- # include Roar::Rails::HAL
27
- # include Roar::Representer::JSON
28
-
29
- module Initializer
30
- def initialize
31
- extend Billit::BillModelRepresenter
32
- extend Roar::Representer::Feature::Client
33
- super
34
- end
35
- end
36
-
37
- def self.included(klass)
38
- klass.send :prepend, Initializer
39
- klass.send :include, ActiveModel::Validations
40
- klass.send :include, Roar::Representer::Feature::HttpVerbs
41
- klass.validates_presence_of :uid
42
- klass.validates :subject_areas, inclusion: { in: @@subject_areas_valid_values }
43
- klass.validates :stage, inclusion: { in: @@stage_valid_values }
44
- klass.validates :initial_chamber, inclusion: { in: @@initial_chamber_valid_values }
45
- klass.validates :current_priority, inclusion: { in: @@current_priority_valid_values }
46
- end
47
-
48
- property :uid
49
- property :short_uid, writeable: false
50
- property :title
51
- property :creation_date
52
- property :source
53
- property :initial_chamber
54
- property :current_priority, writeable: false
55
- property :stage
56
- property :sub_stage
57
- property :status
58
- property :resulting_document
59
- property :law_id, writeable: false
60
- property :merged_bills
61
- property :subject_areas
62
- property :authors
63
- property :publish_date
64
- property :abstract
65
- property :tags
66
-
67
- collection :paperworks, extend: Billit::PaperworkRepresenter, class: Billit::Paperwork, parse_strategy: :sync
68
- collection :priorities, extend: Billit::PriorityRepresenter, class: Billit::Priority, parse_strategy: :sync
69
- collection :reports, extend: Billit::ReportRepresenter, class: Billit::Report, parse_strategy: :sync
70
- collection :documents, extend: Billit::DocumentRepresenter, class: Billit::Document, parse_strategy: :sync
71
- collection :directives, extend: Billit::DirectiveRepresenter, class: Billit::Directive, parse_strategy: :sync
72
- collection :remarks, extend: Billit::RemarkRepresenter, class: Billit::Remark, parse_strategy: :sync
73
- collection :revisions, extend: Billit::RevisionRepresenter, class: Billit::Revision, parse_strategy: :sync
74
-
75
- link :self do
76
- bill_url(self.uid)
77
- end
78
-
79
- link :law_xml do
80
- self.law_xml_link
81
- end
82
-
83
- link :law_web do
84
- self.law_web_link
85
- end
86
-
87
- link :bill_draft do
88
- self.bill_draft_link
89
- end
90
-
91
- @@subject_areas_valid_values =
92
- [
93
- 'Defensa',
94
- 'Impuestos',
95
- 'Economía',
96
- 'Empresas',
97
- 'Hacienda',
98
- 'Relaciones Exteriores',
99
- 'Administración',
100
- 'Asunto Indígena',
101
- 'Zona Extrema',
102
- 'Regionalización',
103
- 'Salud',
104
- 'Minería',
105
- 'Medio Ambiente',
106
- 'Derechos Animales',
107
- 'Vivienda',
108
- 'Obras Públicas',
109
- 'Transporte',
110
- 'Telecomunicaciones',
111
- 'Trabajo',
112
- 'Protección Social',
113
- 'Cultura',
114
- 'Educación',
115
- 'Deportes',
116
- 'Transparencia',
117
- 'Probidad',
118
- 'Elecciones',
119
- 'Participación',
120
- 'Familia',
121
- 'Seguridad',
122
- 'Derechos Fundamentales',
123
- 'Nacionalidad',
124
- 'Reconstrucción Terremoto'
125
- ]
126
-
127
- @@stage_valid_values =
128
- [
129
- 'Archivado',
130
- 'Comisión Mixta Ley de Presupuesto',
131
- 'Comisión Mixta por rechazo de idea de legislar',
132
- 'Comisión Mixta por rechazo de modificaciones',
133
- 'Disc. informe C.Mixta por rechazo de modific. en C...',
134
- 'Discusión veto en Cámara de Origen',
135
- 'Discusión veto en Cámara Revisora',
136
- 'Insistencia',
137
- 'Primer trámite constitucional',
138
- 'Retirado',
139
- 'Segundo trámite constitucional',
140
- 'Tercer trámite constitucional',
141
- 'Tramitación terminada',
142
- 'Trámite de aprobacion presidencial',
143
- 'Trámite finalización en Cámara de Origen'
144
- ]
145
-
146
- @@initial_chamber_valid_values =
147
- [
148
- 'C.Diputados',
149
- 'Senado'
150
- ]
151
-
152
- @@current_priority_valid_values =
153
- [
154
- 'Discusión inmediata',
155
- 'Simple',
156
- 'Sin urgencia',
157
- 'Suma'
158
- ]
159
- end
160
- end