File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [ Keep a Changelog] ( http://keepachangelog.com/ )
6
6
and this project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
7
7
8
+ ## [ 2.4.0] [ 2018-02-01]
9
+
10
+ ### Added
11
+ - Dispatchers for adding syntax sugar to ` param ` and ` options ` (nepalez)
12
+
13
+ ``` ruby
14
+ # Converts `integer: true` to `type: proc(&:to_i)`
15
+ dispatcher = -> (op) { op[:integer ] ? op.merge(type: proc (& :to_i )) : op }
16
+ # Register a dispatcher
17
+ Dry ::Initializer ::Dispatchers << dispatcher
18
+ # Use syntax sugar
19
+ class User
20
+ param :id , integer: true # same as param :id, proc(&:to_i)
21
+ end
22
+ ```
23
+
8
24
## [ 2.3.0] [ 2017-09-19]
9
25
10
26
### Added
@@ -741,3 +757,4 @@ First public release
741
757
[ 2.1.0 ] : https://github.com/dry-rb/dry-initializer/compare/v2.0.0...v2.1.0
742
758
[ 2.2.0 ] : https://github.com/dry-rb/dry-initializer/compare/v2.1.0...v2.2.0
743
759
[ 2.3.0 ] : https://github.com/dry-rb/dry-initializer/compare/v2.2.0...v2.3.0
760
+ [ 2.4.0 ] : https://github.com/dry-rb/dry-initializer/compare/v2.3.0...v2.4.0
Original file line number Diff line number Diff line change 1
1
Gem ::Specification . new do |gem |
2
2
gem . name = "dry-initializer"
3
- gem . version = "2.3 .0"
3
+ gem . version = "2.4 .0"
4
4
gem . author = [ "Vladimir Kochnev (marshall-lee)" , "Andrew Kozin (nepalez)" ]
5
5
gem . email = "andrew.kozin@gmail.com"
6
6
gem . homepage = "https://github.com/dryrb/dry-initializer"
You can’t perform that action at this time.
0 commit comments