parliament-ruby 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/parliament/response.rb +11 -0
- data/lib/parliament/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28594af037be384f693b54a2b86319171df55870
|
4
|
+
data.tar.gz: 93304a061e7860dd550aaf5f3964d016419c93b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df3e037738c1cff50f009e480c49a9c3e556d3c7ce465ec05cf93742d383d5eedd7deea1260a2abad6928c607a0557d0f4c8fe77617fe82f59ff62ddf758d5d6
|
7
|
+
data.tar.gz: 5bcb5bf0637bc0b2577573ecc324b7565aa2df6f06e5819888915ac73b35df00b3dc06cdf1b9d9cd561d77b1e6f8152251272c638927add0658684a28a4cc7d8
|
data/lib/parliament/response.rb
CHANGED
@@ -34,5 +34,16 @@ module Parliament
|
|
34
34
|
end
|
35
35
|
result
|
36
36
|
end
|
37
|
+
|
38
|
+
def sort_by(*parameters)
|
39
|
+
rejected = []
|
40
|
+
grom_nodes = @nodes.dup
|
41
|
+
grom_nodes.delete_if { |node| rejected << node unless parameters.all?{ |param| node.respond_to?(param) } }
|
42
|
+
grom_nodes.sort_by! do |node|
|
43
|
+
parameters.map { |param| node.send(param) }
|
44
|
+
end
|
45
|
+
|
46
|
+
rejected.concat(grom_nodes)
|
47
|
+
end
|
37
48
|
end
|
38
49
|
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
|
+
version: 0.4.0
|
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-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grom
|