README.md in timespan-0.4.4 vs README.md in timespan-0.4.5
- old
+ new
@@ -111,17 +111,20 @@
Custom Timespan datatype:
`Mongoid::Timespanned` adds the following class level macros:
-* `timespan_methods name`
-* `timespan_delegates name`
-* `timespan_setters name`
+* `timespan_methods target, *names`
+* `timespan_delegates target, *names`
+* `timespan_delegate name, target = :period`
+* `timespan_setters target, *names`
+* `timespan_setter target, name`
* `timespan_container_delegates container, timespan_field, *names`
* `timespan_container_delegate container, timespan_field, name`
+Note that all the macros, take an `options` Hash as the last argument, where you can set `override: true` in order to override any existing methods. Otherwise an `ArgumentError` exception will be raised, to warn you of a method name conflict!
```ruby
require 'timespan/mongoid'
class Account
@@ -145,9 +148,11 @@
embedded_in :account
timespan_methods :dates
end
```
+
+Note: See `mongoid_timespan_spec.rb` for more examples of usage, and also see the `ClassMethods` module in `timespanned.rb` :)
Usage example:
```ruby
account = Account.create :period => {:duration => '2 days', :from => Date.today }