alchemy-json_api 0.23.0 → 0.24.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c6090af6d711e4a909628207f0b5f7d916944c60a8482b5b7ff958a38633d73
|
4
|
+
data.tar.gz: 4e70e1de9b2ab1a68ce359c32973deac67a0965ade5021a7cf398ea29bf83a82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56d2a3623ad9e3a8585d5487f94f08c3d4a31f17a177f300252056eec68f5f4223eb86f32eca26238c5d52ecc6481a39d845b8082ea3d5cb4daec2fc25004a92
|
7
|
+
data.tar.gz: 30ca7d8ca1e07d9e924e395ee42c0d4cbf693180052a70f003ccd592267564c2e701aea50462f24f659aad8f39c687d42fa90f05da2633ce2c90a82228a9a3c0
|
@@ -33,6 +33,27 @@ module Alchemy
|
|
33
33
|
}
|
34
34
|
end
|
35
35
|
|
36
|
+
attribute :srcset do |essence|
|
37
|
+
essence.content.settings.fetch(:srcset, []).map do |src|
|
38
|
+
case src
|
39
|
+
when Hash
|
40
|
+
url = essence.picture_url(src)
|
41
|
+
size = src[:size]
|
42
|
+
else
|
43
|
+
url = essence.picture_url(size: src)
|
44
|
+
size = src
|
45
|
+
end
|
46
|
+
width, height = size.split("x", 2)
|
47
|
+
|
48
|
+
{
|
49
|
+
url: url,
|
50
|
+
desc: "#{width}w",
|
51
|
+
width: width,
|
52
|
+
height: height,
|
53
|
+
}
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
36
57
|
attribute :image_name do |essence|
|
37
58
|
essence.picture.name
|
38
59
|
end
|
@@ -39,6 +39,27 @@ module Alchemy
|
|
39
39
|
}
|
40
40
|
end
|
41
41
|
|
42
|
+
attribute :srcset do |ingredient|
|
43
|
+
ingredient.settings.fetch(:srcset, []).map do |src|
|
44
|
+
case src
|
45
|
+
when Hash
|
46
|
+
url = ingredient.picture_url(src)
|
47
|
+
size = src[:size]
|
48
|
+
else
|
49
|
+
url = ingredient.picture_url(size: src)
|
50
|
+
size = src
|
51
|
+
end
|
52
|
+
width, height = size.split("x", 2)
|
53
|
+
|
54
|
+
{
|
55
|
+
url: url,
|
56
|
+
desc: "#{width}w",
|
57
|
+
width: width,
|
58
|
+
height: height,
|
59
|
+
}
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
42
63
|
attribute :image_name do |ingredient|
|
43
64
|
ingredient.picture.name
|
44
65
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alchemy-json_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.24.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Meyerhoff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: alchemy_cms
|