gds-api-adapters 12.5.0 → 13.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/gds_api/finder_schema.rb +9 -3
- data/lib/gds_api/version.rb +1 -1
- data/test/finder_schema_test.rb +27 -3
- metadata +4 -4
@@ -8,8 +8,11 @@ class GdsApi::FinderSchema
|
|
8
8
|
def user_friendly_values(document_attributes)
|
9
9
|
document_attributes.each_with_object({}) do |(k, v), values|
|
10
10
|
values.store(
|
11
|
-
|
12
|
-
|
11
|
+
k.to_s,
|
12
|
+
{
|
13
|
+
label: user_friendly_facet_label(k.to_s),
|
14
|
+
values: user_friendly_facet_value(k.to_s, v),
|
15
|
+
}
|
13
16
|
)
|
14
17
|
end
|
15
18
|
end
|
@@ -29,7 +32,10 @@ class GdsApi::FinderSchema
|
|
29
32
|
|
30
33
|
def user_friendly_facet_value(facet_key, value)
|
31
34
|
Array(value).map { |value|
|
32
|
-
|
35
|
+
{
|
36
|
+
label: find_schema_allowed_value_label(facet_key, value),
|
37
|
+
slug: value,
|
38
|
+
}
|
33
39
|
}
|
34
40
|
end
|
35
41
|
|
data/lib/gds_api/version.rb
CHANGED
data/test/finder_schema_test.rb
CHANGED
@@ -49,8 +49,24 @@ describe GdsApi::FinderSchema do
|
|
49
49
|
|
50
50
|
let(:formatted_attrs) {
|
51
51
|
{
|
52
|
-
"
|
53
|
-
|
52
|
+
"case_type" => {
|
53
|
+
:label => "Case type",
|
54
|
+
:values => [
|
55
|
+
{
|
56
|
+
:label => "CA98 and civil cartels",
|
57
|
+
:slug => "ca98-and-civil-cartels"
|
58
|
+
}
|
59
|
+
]
|
60
|
+
},
|
61
|
+
"market_sector" => {
|
62
|
+
:label => "Market sector",
|
63
|
+
:values => [
|
64
|
+
{
|
65
|
+
:label => "Aerospace",
|
66
|
+
:slug=>"aerospace"
|
67
|
+
}
|
68
|
+
]
|
69
|
+
}
|
54
70
|
}
|
55
71
|
}
|
56
72
|
|
@@ -83,7 +99,15 @@ describe GdsApi::FinderSchema do
|
|
83
99
|
|
84
100
|
let(:formatted_attrs) {
|
85
101
|
{
|
86
|
-
"
|
102
|
+
"market_sector" => {
|
103
|
+
:label => "Market sector",
|
104
|
+
:values => [
|
105
|
+
{
|
106
|
+
:label => "Aerospace",
|
107
|
+
:slug=>"aerospace"
|
108
|
+
}
|
109
|
+
]
|
110
|
+
}
|
87
111
|
}
|
88
112
|
}
|
89
113
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gds-api-adapters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 13.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-07-
|
12
|
+
date: 2014-07-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: plek
|
@@ -405,7 +405,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
405
405
|
version: '0'
|
406
406
|
segments:
|
407
407
|
- 0
|
408
|
-
hash:
|
408
|
+
hash: -1627753500350458436
|
409
409
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
410
410
|
none: false
|
411
411
|
requirements:
|
@@ -414,7 +414,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
414
414
|
version: '0'
|
415
415
|
segments:
|
416
416
|
- 0
|
417
|
-
hash:
|
417
|
+
hash: -1627753500350458436
|
418
418
|
requirements: []
|
419
419
|
rubyforge_project:
|
420
420
|
rubygems_version: 1.8.23
|