README.md in verbalize-2.1.1 vs README.md in verbalize-2.2.0
- old
+ new
@@ -51,11 +51,40 @@
Add.call # => [:ok, 42]
Add.call(a: 660, b: 6) # => [:ok, 666]
```
+## Default Values
+
```ruby
+# You can define defaults via key/value pairs, as so:
+class Add
+ include Verbalize::Action
+ # note that these values are evaluated at load-time as they are not wrapped
+ # in lambdas.
+ input optional: [a: 35, b: 7]
+ def call; a + b; end
+end
+
+# default values can be lazily loaded by passing in a lambda, e.g.:
+
+class Tomorrow
+ include Verbalize::Action
+ input optional: [as_of: -> { Time.now }]
+ def call
+ as_of + 1
+ end
+end
+
+start_time = Tomorrow.call!
+sleep(1)
+end_time = Tomorrow.call!
+end_time - start_time # ~1s; the default is executed each call.
+```
+
+
+```ruby
class Divide
include Verbalize::Action
input :a, :b
@@ -321,9 +350,16 @@
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
+
+## Releasing
+
+- Update changelog, and VERSION
+- Commit to master and push to github
+- [Create a new release on github](https://github.com/taylorzr/verbalize/releases/new)
+-
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/taylorzr/verbalize.