Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add InstanceDSL to isolate #initialize method from mixin
- Loading branch information
Showing
5 changed files
with
34 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
--format documentation | ||
--color | ||
--require spec_helper | ||
--warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module Dry::Initializer | ||
module InstanceDSL | ||
private | ||
|
||
# The method is reloaded explicitly | ||
# in a class that extend [Dry::Initializer], or in its subclasses. | ||
def initialize(*args) | ||
__initialize__(*args) | ||
end | ||
|
||
# The method is redefined implicitly every time | ||
# a `param` or `option` is invoked. | ||
def __initialize__(*); end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters