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,145 +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/representers/motion_representer'
16
- require 'billit_representers/models/paperwork'
17
- require 'billit_representers/models/priority'
18
- require 'billit_representers/models/report'
19
- require 'billit_representers/models/document'
20
- require 'billit_representers/models/directive'
21
- require 'billit_representers/models/remark'
22
- require 'billit_representers/models/revision'
23
- require 'billit_representers/models/motion'
24
-
25
- module Billit
26
- module BillUpdateRepresenter
27
- include Roar::Representer::JSON::HAL
28
- # include Roar::Rails::HAL
29
- # include Roar::Representer::JSON
30
-
31
- module Initializer
32
- def initialize
33
- extend Billit::BillUpdateRepresenter
34
- extend Roar::Representer::Feature::Client
35
- super
36
- end
37
- end
38
-
39
- def self.included(klass)
40
- klass.send :prepend, Initializer
41
- klass.send :include, ActiveModel::Validations
42
- klass.send :include, Roar::Representer::Feature::HttpVerbs
43
- klass.validates_presence_of :uid
44
- klass.validates :subject_areas, inclusion: { in: @@subject_areas_valid_values }
45
- klass.validates :stage, inclusion: { in: @@stage_valid_values }
46
- klass.validates :initial_chamber, inclusion: { in: @@initial_chamber_valid_values }
47
- klass.validates :current_priority, inclusion: { in: @@current_priority_valid_values }
48
- end
49
-
50
- property :uid
51
- property :title
52
- property :creation_date
53
- property :source
54
- property :initial_chamber
55
- property :stage
56
- property :sub_stage
57
- property :status
58
- property :resulting_document
59
- property :bill_draft_link
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: lambda { |x, *| Object.const_defined?("Paperwork") ? Paperwork : BillitPaperwork }
68
- collection :priorities, extend: Billit::PriorityRepresenter, class: lambda { |x, *| Object.const_defined?("Priority") ? Priority : BillitPriority }
69
- collection :reports, extend: Billit::ReportRepresenter, class: lambda { |x, *| Object.const_defined?("Report") ? Report : BillitReport }
70
- collection :documents, extend: Billit::DocumentRepresenter, class: lambda { |x, *| Object.const_defined?("Document") ? Document : BillitDocument }
71
- collection :directives, extend: Billit::DirectiveRepresenter, class: lambda { |x, *| Object.const_defined?("Directive") ? Directive : BillitDirective }
72
- collection :remarks, extend: Billit::RemarkRepresenter, class: lambda { |x, *| Object.const_defined?("Remark") ? Remark : BillitRemark }
73
- collection :revisions, extend: Billit::RevisionRepresenter, class: lambda { |x, *| Object.const_defined?("Revision") ? Revision : BillitRevision }
74
- collection :motions, extend: Billit::MotionRepresenter, class: lambda { |x, *| Object.const_defined?("Motion") ? Motion : BillitMotion }
75
-
76
- @@subject_areas_valid_values =
77
- [
78
- 'Defensa',
79
- 'Impuestos',
80
- 'Economía',
81
- 'Empresas',
82
- 'Hacienda',
83
- 'Relaciones Exteriores',
84
- 'Administración',
85
- 'Asunto Indígena',
86
- 'Zona Extrema',
87
- 'Regionalización',
88
- 'Salud',
89
- 'Minería',
90
- 'Medio Ambiente',
91
- 'Derechos Animales',
92
- 'Vivienda',
93
- 'Obras Públicas',
94
- 'Transporte',
95
- 'Telecomunicaciones',
96
- 'Trabajo',
97
- 'Protección Social',
98
- 'Cultura',
99
- 'Educación',
100
- 'Deportes',
101
- 'Transparencia',
102
- 'Probidad',
103
- 'Elecciones',
104
- 'Participación',
105
- 'Familia',
106
- 'Seguridad',
107
- 'Derechos Fundamentales',
108
- 'Nacionalidad',
109
- 'Reconstrucción Terremoto'
110
- ]
111
-
112
- @@stage_valid_values =
113
- [
114
- 'Archivado',
115
- 'Comisión Mixta Ley de Presupuesto',
116
- 'Comisión Mixta por rechazo de idea de legislar',
117
- 'Comisión Mixta por rechazo de modificaciones',
118
- 'Disc. informe C.Mixta por rechazo de modific. en C...',
119
- 'Discusión veto en Cámara de Origen',
120
- 'Discusión veto en Cámara Revisora',
121
- 'Insistencia',
122
- 'Primer trámite constitucional',
123
- 'Retirado',
124
- 'Segundo trámite constitucional',
125
- 'Tercer trámite constitucional',
126
- 'Tramitación terminada',
127
- 'Trámite de aprobacion presidencial',
128
- 'Trámite finalización en Cámara de Origen'
129
- ]
130
-
131
- @@initial_chamber_valid_values =
132
- [
133
- 'C.Diputados',
134
- 'Senado'
135
- ]
136
-
137
- @@current_priority_valid_values =
138
- [
139
- 'Discusión inmediata',
140
- 'Simple',
141
- 'Sin urgencia',
142
- 'Suma'
143
- ]
144
- end
145
- 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 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
@@ -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 DirectiveRepresenter
10
- include Roar::Representer::JSON::HAL
11
- # include Roar::Representer::JSON
12
-
13
- module Initializer
14
- def initialize
15
- extend Billit::DirectiveRepresenter
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,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/rails/hal'
6
- require 'roar/representer/json/hal'
7
-
8
- module Billit
9
- module DocumentRepresenter
10
- include Roar::Representer::JSON::HAL
11
- # include Roar::Representer::JSON
12
-
13
- module Initializer
14
- def initialize
15
- extend Billit::DocumentRepresenter
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 :number
27
- property :date
28
- property :step
29
- property :stage
30
- property :type
31
- property :chamber
32
- property :link
33
-
34
- end
35
- end
@@ -1,44 +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/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 }
39
-
40
- link :self do
41
- motion_url(self.id)
42
- end
43
- end
44
- end
@@ -1,29 +0,0 @@
1
- require 'roar/representer/json'
2
- require 'billit_representers/representers/paperwork_representer'
3
-
4
- module Billit
5
- module PaperworkCollectionRepresenter
6
- # include Roar::Representer
7
- include Roar::Representer::JSON
8
- include Roar::Representer::Feature::Hypermedia
9
-
10
- module Initializer
11
- def initialize
12
- extend Billit::PaperworkCollectionRepresenter
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
- collection :paperworks, :extend => PaperworkRepresenter, :class => lambda { |x, *| Object.const_defined?("Paperwork") ? Paperwork : BillitPaperwork }, parse_strategy: :sync
24
-
25
- def paperworks
26
- collect
27
- end
28
- end
29
- end
@@ -1,60 +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 PaperworkRepresenter
10
- include Roar::Representer::JSON::HAL
11
- # include Roar::Representer::JSON
12
-
13
- module Initializer
14
- def initialize
15
- extend Billit::PaperworkRepresenter
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 :chamber
27
- property :created_at
28
- property :date
29
- property :description
30
- property :session
31
- property :stage
32
- property :updated_at
33
- property :bill_uid
34
- property :timeline_status
35
-
36
- link :self do
37
- paperwork_url(self.id)
38
- end
39
-
40
- link :bill do
41
- bill_url(bill_uid)
42
- end
43
-
44
- @@timeline_status_valid_values =
45
- [
46
- 'Ingreso',
47
- 'Avanza',
48
- 'Indicaciones',
49
- 'Votación',
50
- 'Urgencia',
51
- 'Rechazado',
52
- 'Inasistencia',
53
- 'Descartado',
54
- 'Informe',
55
- 'Retiro de Urgencia',
56
- 'Estado por Defecto'
57
- ]
58
-
59
- end
60
- 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/rails/hal'
6
- require 'roar/representer/json/hal'
7
-
8
- module Billit
9
- module PriorityRepresenter
10
- include Roar::Representer::JSON::HAL
11
- # include Roar::Representer::JSON
12
-
13
- module Initializer
14
- def initialize
15
- extend Billit::PriorityRepresenter
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 :type
27
- property :entry_date
28
- property :entry_message
29
- property :entry_chamber
30
- property :withdrawal_date
31
- property :withdrawal_message
32
- property :withdrawal_chamber
33
-
34
- end
35
- end
@@ -1,31 +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 RemarkRepresenter
10
- include Roar::Representer::JSON::HAL
11
- # include Roar::Representer::JSON
12
-
13
- module Initializer
14
- def initialize
15
- extend Billit::RemarkRepresenter
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 :event
28
- property :stage
29
-
30
- end
31
- end