Skip to content

Releases: dry-rb/dry-initializer

Add `#using` method for shared options

11 Oct 13:54
Compare
Choose a tag to compare

Instead of

param  :foo, reader: :private
option :bar, reader: :private

Use

using reader: :private do
  param  :foo
  option :bar
end

Support for `private` and `protected` attibute readers

08 Oct 21:47
Compare
Choose a tag to compare
param :id # public reader (default)
param :name,   reader: :private
param :phone,  reader: :protected
param :email,  reader: false # no reader
param :age,    reader: public
param :gender, reader: true # public as well

Support optional params and options

21 Aug 19:06
Compare
Choose a tag to compare
class User
  extend Dry::Initializer

 param :name, type: Dry::Types['strict.string']
 param :email, type: Dry::Types['strict.string'], default: proc { nil }
 param :phone, type: Dry::Types['strict.string'], optional: true
end

user = User.new "Andrew"

user.name  # => "Andrew"
user.email # => nil (default)
user.phone # => Dry::Types::UNDEFINED (new feature)

Support dry-types only as type constraints

28 May 19:44
Compare
Choose a tag to compare
0.4.0

Bump v0.4.0 (change types constraints)

Deprecate non-dry-types as type constraints

28 May 19:32
Compare
Choose a tag to compare
0.3.3

Bump v0.3.3 (deprecation warnings)

Bug fix

25 May 07:55
Compare
Choose a tag to compare
v0.3.2

Bump v0.3.2 (bug fix)

Support for tolerance to unknown options

22 May 06:40
Compare
Choose a tag to compare

Class helpers tolerant_to_unknown_options and intolerant_to_unknown_options allows switching on/off a regime where undeclared options are ignored without error.

Update Mixin interface for adding plugins

19 May 10:18
Compare
Choose a tag to compare

Use Mixin#register_initializer_plugin for adding plugins:

mixin.register_initializer_plugin NewPlugin

instead of:

mixin.initializer_builder.register NewPlugin

Bug fix

18 May 23:52
Compare
Choose a tag to compare
v0.2.1

Bump v0.2.1 (bug fix)

Support plugin system

15 May 17:29
Compare
Choose a tag to compare
v0.2.0

Bump v0.2.0