problem_details 0.2.2 → 0.2.3

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
  SHA256:
3
- metadata.gz: fd24fabc07eeb260be9ba8ffcdedd2c26d6a6dab7cb5ad352afb6496c31ecde5
4
- data.tar.gz: 4e60cd1565a490714a107de8a32bc96acd09f6471ebf7ea13b87962bd26ac818
3
+ metadata.gz: 3dbc10dcfafafc3f0a5ab8e133bed56285533a9adcba459171f4d57c9d9b3136
4
+ data.tar.gz: a34e365906ec1b5d4d4d8946369a053c40debef9d871e84482369995ef011f9c
5
5
  SHA512:
6
- metadata.gz: e43be8595c80c1a077b739745b05fa87930dfc5a05bea2ebd9a4dd373622936f9139d9e3321a3df6fd53c3fcfdae90df67de27db7b0e68367af23a6386ef1c46
7
- data.tar.gz: 6886cef6f8cd9010dfc8befa0b4e068eb4d8c88e2bb2b495c913abade10fd92df808ac6af368469ae3202ad37254afc4292f1b62f6535a4bf22b0293bfb3e1d5
6
+ metadata.gz: bb93e0090a87c06f4021b5a70e3056c7c187629d93d6383aaa61153108dad7ae7dd426f2874af0434c3a3c8b4efc960fad76a32434737673afff9aa21e523d3b
7
+ data.tar.gz: 673be8931bf5b2ebabd6818b9e40f023bc8304c6d83dafd363721598df28aa83fca8d8b56e1061e3701ccf6fced41ae3de26d2b7af2da99c47851ed6933a889d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.2.3 / 2021-09-03
2
+
3
+ * Support the `#to_hash` implicit conversion protocol (#8) by @stevenharman
4
+
1
5
  ## 0.2.2 / 2019-10-30
2
6
 
3
7
  * Remove default about:blank type (#5) by @akrawchyk
@@ -9,7 +13,7 @@
9
13
  ## 0.2.0 / 2018-03-20
10
14
 
11
15
  ### Enhancements:
12
- * Introduce a new gem, `sinatra-problem_details`, the Sinatra problem detail extention.
16
+ * Introduce a new gem, `sinatra-problem_details`, the Sinatra problem detail extension.
13
17
 
14
18
  ## 0.1.0 / 2018-03-26
15
19
 
data/README.md CHANGED
@@ -1,4 +1,7 @@
1
- # ProblemDetails [![Build Status](https://travis-ci.org/nikushi/problem_details.svg?branch=master)](https://travis-ci.org/nikushi/problem_details) [![Gem Version](https://badge.fury.io/rb/problem_details.svg)](https://badge.fury.io/rb/problem_details)
1
+ # ProblemDetails
2
+
3
+ [![CI](https://github.com/nikushi/problem_details/actions/workflows/ci.yml/badge.svg)](https://github.com/nikushi/problem_details/actions/workflows/ci.yml)
4
+ [![Gem Version](https://badge.fury.io/rb/problem_details.svg)](https://badge.fury.io/rb/problem_details)
2
5
 
3
6
  ProblemDetails is an implementation of [RFC7807 Problem Details for HTTP APIs](https://tools.ietf.org/html/rfc7807).
4
7
 
@@ -197,7 +200,6 @@ Content-Type: application/problem+json
197
200
  "title": "Bad Request",
198
201
  "status": 400,
199
202
  "foo": "bar"
200
- }
201
203
  }
202
204
  ```
203
205
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.3
@@ -19,7 +19,7 @@ module ProblemDetails
19
19
  @extentions = params
20
20
  end
21
21
 
22
- def to_h
22
+ def to_hash
23
23
  h = {}
24
24
  %i[type title status detail instance].each do |key|
25
25
  value = public_send(key)
@@ -27,9 +27,10 @@ module ProblemDetails
27
27
  end
28
28
  h.merge(@extentions)
29
29
  end
30
+ alias_method :to_h, :to_hash
30
31
 
31
32
  def to_json
32
- to_h.to_json
33
+ to_hash.to_json
33
34
  end
34
35
  end
35
36
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ProblemDetails
4
- VERSION = '0.2.2'
4
+ VERSION = '0.2.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: problem_details
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nobuhiro Nikushi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-30 00:00:00.000000000 Z
11
+ date: 2021-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack