beerdb-models 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/beerdb/serializers/beer.rb +7 -4
- data/lib/beerdb/serializers/brewery.rb +5 -3
- data/lib/beerdb/version.rb +2 -2
- 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: 61c3b6f7c9a626c2eaa84b40df4e30239f8ebbbd
|
4
|
+
data.tar.gz: c406b32c8144ae48cc7368dabfe87bbdf35c8498
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d8854c6879d32ccfaa980d942d38c1c994074b102c2149a140e84ad0705e81522f4d807b2c9f1ab57c16bbaa4ab35f38be43309bc958f1bbf757a926fa412a3
|
7
|
+
data.tar.gz: cbeb2f3aacc0113d82ffe4ccf3211d6abc316d6a5f06ce195cd48238f718e7684ae5ba92addf3488a98cc6cc560e264d6e23c7ed50bcba664885c1fadc4280e3
|
@@ -7,10 +7,13 @@ module BeerDb::Model
|
|
7
7
|
def initialize( beer )
|
8
8
|
@beer = beer
|
9
9
|
end
|
10
|
-
|
10
|
+
|
11
11
|
attr_reader :beer
|
12
|
-
|
12
|
+
|
13
13
|
def as_json
|
14
|
+
## note: as_json returns record as a hash
|
15
|
+
## note: NOT yet converted with to_json or JSON.pretty_generate etc.
|
16
|
+
|
14
17
|
brewery = {}
|
15
18
|
if beer.brewery.present?
|
16
19
|
brewery = { key: beer.brewery.key,
|
@@ -36,8 +39,8 @@ module BeerDb::Model
|
|
36
39
|
tags: tags,
|
37
40
|
brewery: brewery,
|
38
41
|
country: country }
|
39
|
-
|
40
|
-
data
|
42
|
+
|
43
|
+
data
|
41
44
|
end
|
42
45
|
|
43
46
|
end # class BeerSerializer
|
@@ -7,10 +7,12 @@ module BeerDb::Model
|
|
7
7
|
def initialize( brewery )
|
8
8
|
@brewery = brewery
|
9
9
|
end
|
10
|
-
|
10
|
+
|
11
11
|
attr_reader :brewery
|
12
|
-
|
12
|
+
|
13
13
|
def as_json
|
14
|
+
## note: as_json returns record as a hash
|
15
|
+
## note: NOT yet converted with to_json or JSON.pretty_generate etc.
|
14
16
|
|
15
17
|
beers = []
|
16
18
|
brewery.beers.each do |b|
|
@@ -38,7 +40,7 @@ module BeerDb::Model
|
|
38
40
|
beers: beers,
|
39
41
|
country: country }
|
40
42
|
|
41
|
-
data
|
43
|
+
data
|
42
44
|
end
|
43
45
|
|
44
46
|
end # class BrewerySerializer
|
data/lib/beerdb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beerdb-models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: worlddb-models
|