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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 168648ce147b91dcfd81733a7a73faffce8ffc628591fd4dcf414595488c4546
4
- data.tar.gz: f0c267805bbfff7fa30c2a7c90e53c6c1576fc1b322114821339a233d8d14bd3
3
+ metadata.gz: '009dbf0cdec8342311b96c032049071cfccdfe8ee9e77788003012dfd6c93384'
4
+ data.tar.gz: 85fb0d1853b67a77e11a05ae8c5aa002ff687860737e94f891617a4ca149d50a
5
5
  SHA512:
6
- metadata.gz: 5f6c9d09ef8fb66e28ff54a02fc19a00fb961f810dd106eea4fffa11b714869a0381217fb643e5862e95410772c312c093d771b42e2acdef669258479757d0b4
7
- data.tar.gz: 901e53ea53069eb72321abc743f7ef6d195079e7e3be82e08851663af62df1face08c2844684f617adec2bba0f13f1794b31b6a1181ed3aa44f605c767f9a4eb
6
+ metadata.gz: 18ca9e1dcdfc2d3d7b77e089ad3701b36cb3dde87952e2f02f1c6b2a024b958d4db8c1fa97bf678cd4b351fc9aa3ae179df08fab55046de336009c62dc99980c
7
+ data.tar.gz: 92a79c12064201f63ba6b7ca1d494c1c1f09110ba7498aba78b0ebbc26eb3c34a98f8e37b38f7884965e0def82e60f9923b295ba516feaf49aeed53b33484907
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tributa (0.1.1)
4
+ tributa (0.1.2)
5
5
  nokogiri
6
6
 
7
7
  GEM
@@ -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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Tributa
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tributa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - mario