parliament-ruby 0.4.0 → 0.4.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35b478eb95f94d239b43577926d991cd8d7e185d
|
4
|
+
data.tar.gz: 80e3214e334fb5568e2474b76c6ccf4f510b469b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: caa6aae8ea8c2a3c27fbecd534225010e7c4068651d972502bca85391d02623899a3f5f617671be79c1923f5a81259fd7d1e01043ad66c6fabe97b78811b807c
|
7
|
+
data.tar.gz: 9705db9a2c52ae0ae87e9fbe23693da6b1a1323b1766618f26f7e23dbfc7e39257ae3b32f73f4c9836f93bcad7ff33dff221956457ba4274dc9ce8cb8200b42c
|
@@ -6,11 +6,11 @@ module Parliament
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def start_date
|
9
|
-
respond_to?(:constituencyGroupStartDate) ? constituencyGroupStartDate :
|
9
|
+
respond_to?(:constituencyGroupStartDate) ? DateTime.parse(constituencyGroupStartDate) : nil
|
10
10
|
end
|
11
11
|
|
12
12
|
def end_date
|
13
|
-
respond_to?(:constituencyGroupEndDate) ? constituencyGroupEndDate :
|
13
|
+
respond_to?(:constituencyGroupEndDate) ? DateTime.parse(constituencyGroupEndDate) : nil
|
14
14
|
end
|
15
15
|
|
16
16
|
def seats
|
data/lib/parliament/request.rb
CHANGED
@@ -58,8 +58,12 @@ module Parliament
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def assign_decorator(object)
|
61
|
+
return object unless object.respond_to?(:type)
|
62
|
+
|
61
63
|
object_type = Grom::Helper.get_id(object.type)
|
64
|
+
|
62
65
|
return object unless Parliament::Decorators.constants.include?(object_type.to_sym)
|
66
|
+
|
63
67
|
decorator_module = Object.const_get("Parliament::Decorators::#{object_type}")
|
64
68
|
object.extend(decorator_module)
|
65
69
|
end
|
data/lib/parliament/response.rb
CHANGED
@@ -38,7 +38,7 @@ module Parliament
|
|
38
38
|
def sort_by(*parameters)
|
39
39
|
rejected = []
|
40
40
|
grom_nodes = @nodes.dup
|
41
|
-
grom_nodes.delete_if { |node| rejected << node unless parameters.all?{ |param| node.respond_to?(param) } }
|
41
|
+
grom_nodes.delete_if { |node| rejected << node unless parameters.all? { |param| node.respond_to?(param) } }
|
42
42
|
grom_nodes.sort_by! do |node|
|
43
43
|
parameters.map { |param| node.send(param) }
|
44
44
|
end
|
data/lib/parliament/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parliament-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Rayner
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grom
|