README.md in myrrha-1.1.0 vs README.md in myrrha-1.2.0
- old
+ new
@@ -15,11 +15,11 @@
### Bundler & Require
# Bug fixes (tiny) do not even add new default rules to coerce and
# to\_ruby\_literal. Minor version can, which could break your code.
# Therefore, please always use:
- gem "myrrha", "~> 1.0.0"
+ gem "myrrha", "~> 1.1.0"
## Links
* http://www.rubydoc.info/gems/myrrha/1.1.0/file/README.md (read this file there!)
* http://github.com/blambeau/myrrha (source code)
@@ -454,8 +454,17 @@
rules.coerce("12", PosInt) # => 12
# and correctly fails in each case!
rules.coerce("-12", Integer) # => -12
rules.coerce("-12", PosInt) # => ArgumentError, "Invalid value -12 for PosInt"
-
-
-
\ No newline at end of file
+
+Note that if you want to provide additional tooling to your factored domain,
+the following way of creating them also works:
+
+ class PosInt < Integer
+ extend Myrrha::Domain
+
+ def self.predicate
+ @predicate ||= lambda{|i| i > 0}
+ end
+
+ end