tributa 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/tributa/table.rb +12 -0
- data/lib/tributa/table/row.rb +18 -0
- data/lib/tributa/version.rb +1 -1
- 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: '009dbf0cdec8342311b96c032049071cfccdfe8ee9e77788003012dfd6c93384'
|
4
|
+
data.tar.gz: 85fb0d1853b67a77e11a05ae8c5aa002ff687860737e94f891617a4ca149d50a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18ca9e1dcdfc2d3d7b77e089ad3701b36cb3dde87952e2f02f1c6b2a024b958d4db8c1fa97bf678cd4b351fc9aa3ae179df08fab55046de336009c62dc99980c
|
7
|
+
data.tar.gz: 92a79c12064201f63ba6b7ca1d494c1c1f09110ba7498aba78b0ebbc26eb3c34a98f8e37b38f7884965e0def82e60f9923b295ba516feaf49aeed53b33484907
|
data/Gemfile.lock
CHANGED
data/lib/tributa/table.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
1
3
|
module Tributa
|
2
4
|
class Table
|
3
5
|
attr_reader :rows
|
@@ -13,5 +15,15 @@ module Tributa
|
|
13
15
|
row.year == year.to_s
|
14
16
|
end
|
15
17
|
end
|
18
|
+
|
19
|
+
def as_json
|
20
|
+
{
|
21
|
+
rows: rows.map(&:as_json)
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
def to_json
|
26
|
+
as_json.to_json
|
27
|
+
end
|
16
28
|
end
|
17
29
|
end
|
data/lib/tributa/table/row.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
1
3
|
module Tributa
|
2
4
|
class Table::Row
|
3
5
|
attr_reader :canton, :year, :community, :canton_rate, :community_rate, :reformed_rate, :catholic_rate
|
@@ -11,5 +13,21 @@ module Tributa
|
|
11
13
|
@reformed_rate,
|
12
14
|
@catholic_rate = columns
|
13
15
|
end
|
16
|
+
|
17
|
+
def as_json
|
18
|
+
{
|
19
|
+
canton: canton,
|
20
|
+
year: year,
|
21
|
+
community: community,
|
22
|
+
canton_rate: canton_rate,
|
23
|
+
community_rate: community_rate,
|
24
|
+
reformed_rate: reformed_rate,
|
25
|
+
catholic_rate: catholic_rate
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
def to_json
|
30
|
+
as_json.to_json
|
31
|
+
end
|
14
32
|
end
|
15
33
|
end
|
data/lib/tributa/version.rb
CHANGED