grape-hypertext_application_language 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ffe1cef37af0bb17749a6a6a1a07e522560f61ce
4
- data.tar.gz: 2673e37724c016727d7bb999c69df7e9c486060e
3
+ metadata.gz: a0270f7fa287e3892d4b57867ba1ced85b3e524e
4
+ data.tar.gz: 508c56ced3f8c7c52ed3cc6c537ffbb79a182372
5
5
  SHA512:
6
- metadata.gz: 5ea3bc42966802ff300ce2ec91ca2d00125b66e2c12fcd697a5aa213a0f16aa666ca2fb16741ed75c98481d18a3fe41f20c8df333022824e56b8797a363b0384
7
- data.tar.gz: 31c11910e5f8c6cecafff58591602e7d1894eb7d6eac1fa42f132f13525b7dd77ffd58740c0bb93342e8a63e6d3fa61fc0e5d970ffb37a848392cb44dad8456c
6
+ metadata.gz: c8081adaec26fb9043931e1272e106d9f72ad2724b8da8123ba7cde3cd230954d0c782e43e2c6e53b0abc887cda355d4d6f59799b0a1032cd0ff6427c8167fe8
7
+ data.tar.gz: 6b1af1d01b958aa8494679bae0d6bf85450f6ee882a634720aacd3ac1938a4bbc8bccc254d82b8177d50a92a4877da119fccef01cbc30914a70959165f7dfaea
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- grape-hypertext_application_language (0.1.0)
4
+ grape-hypertext_application_language (0.1.1)
5
5
  addressable
6
6
  grape
7
7
  hypertext_application_language
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'grape-hypertext_application_language'
3
- spec.version = '0.1.0'
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) && body.first.respond_to?(:to_hal)
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-hypertext_application_language
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roy Ratcliffe