grape-hypertext_application_language 0.1.0 → 0.1.1
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/grape-hypertext_application_language.gemspec +1 -1
- data/lib/grape/formatter/hal/json.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0270f7fa287e3892d4b57867ba1ced85b3e524e
|
4
|
+
data.tar.gz: 508c56ced3f8c7c52ed3cc6c537ffbb79a182372
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8081adaec26fb9043931e1272e106d9f72ad2724b8da8123ba7cde3cd230954d0c782e43e2c6e53b0abc887cda355d4d6f59799b0a1032cd0ff6427c8167fe8
|
7
|
+
data.tar.gz: 6b1af1d01b958aa8494679bae0d6bf85450f6ee882a634720aacd3ac1938a4bbc8bccc254d82b8177d50a92a4877da119fccef01cbc30914a70959165f7dfaea
|
data/Gemfile.lock
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'grape-hypertext_application_language'
|
3
|
-
spec.version = '0.1.
|
3
|
+
spec.version = '0.1.1'
|
4
4
|
spec.summary = %q{Grape extensions for Hypertext Application Language}
|
5
5
|
spec.description = %q{}
|
6
6
|
spec.homepage = 'http://stateless.co/hal_specification.html'
|
@@ -31,7 +31,7 @@ module Grape::Formatter::Hal
|
|
31
31
|
# and uses the path, less its leading slash, as the relation.
|
32
32
|
def self.call(body, env)
|
33
33
|
unless body.is_a?(HypertextApplicationLanguage::Representation)
|
34
|
-
if body.respond_to?(:first)
|
34
|
+
if body.respond_to?(:first)
|
35
35
|
representation = HypertextApplicationLanguage::Representation.new
|
36
36
|
|
37
37
|
rel = env['PATH_INFO'][1..-1]
|
@@ -39,6 +39,7 @@ module Grape::Formatter::Hal
|
|
39
39
|
representation.with_link(HypertextApplicationLanguage::Link::SELF_REL, href)
|
40
40
|
|
41
41
|
body.each do |resource|
|
42
|
+
continue unless resource.respond_to?(:to_hal)
|
42
43
|
resource_representation = resource.to_hal(env: env)
|
43
44
|
representation.with_link(rel, resource_representation.link.href)
|
44
45
|
representation.with_representation(rel, resource_representation)
|