billit_representers 0.9.8 → 0.9.9

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: e708a4b124797e8c4b6e7ba0af45ba1890a89368
4
- data.tar.gz: 72669eef4539182b81baef9e73fd1df427b3c543
3
+ metadata.gz: 22bc093f9bc20035ebb4eefe3435b830a9e4df15
4
+ data.tar.gz: c1b23c0afee6746d9b8b4feae38269f7779c6ce9
5
5
  SHA512:
6
- metadata.gz: d061362b389b968a818b82386f13c8a7a4d82f4ecaa226dc37adc456de70843c1c76cb5c6d539c40261061b9201a8625daae2a13f0ca1bcc637b80667618a4a6
7
- data.tar.gz: ba80b2bf2fded04f06f74fd47c541db24b63c14c3fbc6ccdc82ecf1247732a352d829820d7150131d69b31a48010683426d63efd24614f636d239ba0a2c5baac
6
+ metadata.gz: 786e4060a4ea39fe2ab98f426a73c8d1dca07888e3317f39849289ed059ab2b267fafd25200059838936213909c35ebfe4bb8a74d2027c01a0a825ea6f167c0b
7
+ data.tar.gz: 8819a1c05ad89e1cd25738ec84f4f2c52191e63099d2056249090927c8f8404b44c228fa308b89add2ae5ce0f88ce0d4d1f73bd6b769067795397953abe66030
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'billit_representers'
3
- gem.version = '0.9.8'
3
+ gem.version = '0.9.9'
4
4
  gem.date = '2014-07-01'
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)."
@@ -0,0 +1,6 @@
1
+ require 'billit_representers/representers/bill_update_representer'
2
+ module Billit
3
+ class BillUpdate
4
+ include Billit::BillUpdateRepresenter
5
+ end
6
+ end
@@ -0,0 +1,76 @@
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
+ end
76
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: billit_representers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.8
4
+ version: 0.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcel Augsburger
@@ -68,6 +68,7 @@ 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/bill_update.rb
71
72
  - lib/billit_representers/models/count.rb
72
73
  - lib/billit_representers/models/directive.rb
73
74
  - lib/billit_representers/models/document.rb
@@ -83,6 +84,7 @@ files:
83
84
  - lib/billit_representers/representers/bill_basic_representer.rb
84
85
  - lib/billit_representers/representers/bill_page_representer.rb
85
86
  - lib/billit_representers/representers/bill_representer.rb
87
+ - lib/billit_representers/representers/bill_update_representer.rb
86
88
  - lib/billit_representers/representers/count_representer.rb
87
89
  - lib/billit_representers/representers/directive_representer.rb
88
90
  - lib/billit_representers/representers/document_representer.rb