statbank_denmark 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG +6 -0
- data/README.md +1 -0
- data/lib/StatBankDenmark/Client.rb +3 -0
- data/lib/StatBankDenmark/VERSION.rb +1 -1
- data/lib/StatBankDenmark.rb +3 -0
- data/test/StatBankDenmark/Client_test.rb +5 -0
- data/test/StatBankDenmark_test.rb +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6d0a8e0c92420913c343d904f90f28636ff241d0a9d218d9ca24c170aff2a6ad
|
|
4
|
+
data.tar.gz: b9dc4ace09453161698d89f42fded461dc84be0f7d6b18c2c8a40ed9fd2e2c2b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 24f71e8c419da107d3398b516d6813f15dd6f70fb9c718daccd622565435d7aabcc10f22887061969b727f23e0891f5a506fc69c16576951cea25f1b83e20356
|
|
7
|
+
data.tar.gz: 7416ec1be1476ea1738bc9058a049927b03f6b61308f04be7d1f35a409c52e0f7a1218b1bb5d4e3e809f9d269a1e7fd927019e661f30e09c60170ee4bd9ca74b
|
data/CHANGELOG
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## 20260928
|
|
4
4
|
|
|
5
|
+
0.1.1: alias_method :tableinfo, :table_info
|
|
6
|
+
|
|
7
|
+
1. + StatBankDenmark.tableinfo
|
|
8
|
+
2. + StatBankDenmark::Client#tableinfo
|
|
9
|
+
3. ~ StatBankDenmark::VERSION: /0.1.0/0.1.1/
|
|
10
|
+
|
|
5
11
|
0.1.0: + StatBankDenmark::Tables
|
|
6
12
|
|
|
7
13
|
1. + StatBankDenmark::Tables: six crime and population tables and their dimensions, taken from table_info.
|
data/README.md
CHANGED
|
@@ -58,6 +58,7 @@ StatBankDenmark.tables(include_inactive: true, subject: 4)
|
|
|
58
58
|
StatBankDenmark.table_info('STRAF42') # implicitly format: 'json'
|
|
59
59
|
StatBankDenmark.table_info('STRAF42', format: 'json') # explicitly format: 'json'
|
|
60
60
|
StatBankDenmark.table_info('STRAF42', format: 'csv') # format: 'csv'
|
|
61
|
+
StatBankDenmark.tableinfo('STRAF42') # an alias, /tableinfo being the endpoint
|
|
61
62
|
|
|
62
63
|
# Get data from a specific table
|
|
63
64
|
StatBankDenmark.data('STRAF42') # implicitly format: 'csv'
|
|
@@ -72,6 +72,9 @@ module StatBankDenmark
|
|
|
72
72
|
)
|
|
73
73
|
handle_response(response)
|
|
74
74
|
end
|
|
75
|
+
# The endpoint is /tableinfo, which is how StatBank's own documentation names
|
|
76
|
+
# it, and the spelling anyone arriving from there reaches for first.
|
|
77
|
+
alias_method :tableinfo, :table_info
|
|
75
78
|
|
|
76
79
|
def data(
|
|
77
80
|
table_id,
|
data/lib/StatBankDenmark.rb
CHANGED
|
@@ -18,6 +18,9 @@ module StatBankDenmark
|
|
|
18
18
|
def table_info(table_id, **options)
|
|
19
19
|
client.table_info(table_id, **options)
|
|
20
20
|
end
|
|
21
|
+
# The endpoint is /tableinfo, which is how StatBank's own documentation names
|
|
22
|
+
# it, and the spelling anyone arriving from there reaches for first.
|
|
23
|
+
alias_method :tableinfo, :table_info
|
|
21
24
|
|
|
22
25
|
def data(table_id, **options)
|
|
23
26
|
client.data(table_id, **options)
|
|
@@ -132,6 +132,11 @@ describe StatBankDenmark::Client do
|
|
|
132
132
|
end
|
|
133
133
|
end
|
|
134
134
|
|
|
135
|
+
it "answers to tableinfo, which is what the endpoint is called" do
|
|
136
|
+
_(client).must_respond_to(:tableinfo)
|
|
137
|
+
_(StatBankDenmark::Client.instance_method(:tableinfo).original_name).must_equal(:table_info)
|
|
138
|
+
end
|
|
139
|
+
|
|
135
140
|
it "raises ArgumentError for nil table_id" do
|
|
136
141
|
_(proc{client.table_info(nil)}).must_raise(ArgumentError)
|
|
137
142
|
end
|
|
@@ -11,5 +11,10 @@ describe StatBankDenmark do
|
|
|
11
11
|
_(StatBankDenmark).must_respond_to(:data)
|
|
12
12
|
_(StatBankDenmark).must_respond_to(:search)
|
|
13
13
|
end
|
|
14
|
+
|
|
15
|
+
it "answers to tableinfo, which is what the endpoint is called" do
|
|
16
|
+
_(StatBankDenmark).must_respond_to(:tableinfo)
|
|
17
|
+
_(StatBankDenmark.method(:tableinfo).original_name).must_equal(:table_info)
|
|
18
|
+
end
|
|
14
19
|
end
|
|
15
20
|
end
|