1.7.0
Highlights
New _Predicate type
We added a new _Predicate type which essentially combines a proc with a description. You can use it like this:
_Predicate("Starts with 'Hello'") { it.start_with?("Hello") }after_initialize can now be privately scoped
private def after_initialize
# do stuff here
end[Experimental] Literal::Value and Literal::Delegator classes
Literal::Value and Literal::Delegator are new abstractions for single-value objects. Here’s an example of Literal::Value.
class EmailAddress < Literal::Value(String)
delegate :length
def domain
value.split("@").last
end
endLiteral::Delegator is similar except it delegates all missing methods to the underlying value. We’ll post more documentation soon.
PRs
- The
propmethod should return its name so it can be chained with other macros by @joeldrapper in #292 - Add
_Predicatetype by @joeldrapper in #290 - feat: Allow private-scoped after_initialize hooks by @ixti in #301
- Switch to Zeitwerk for code loading by @joeldrapper in #305
- Value objects by @joeldrapper in #293
- Literal branded types by @joeldrapper in #303
- Simplify the subtype method by @joeldrapper in #307
- Make JRuby builds experimental by @joeldrapper in #310
- Improve interface type compaisons by @joeldrapper in #308
New Contributors
Full Changelog: 1.6.0...1.7.0