README.md in surrounded-0.9.6 vs README.md in surrounded-0.9.7
- old
+ new
@@ -69,10 +69,20 @@
context = Employment.new(employee: user1, boss: user2)
```
This will allow you to prepare your accessing code to use keywords.
+If you need to override the initializer with additional work, you have the ability to use a block to be evaluated in the context of the initialized object.
+
+```ruby
+initialize :role1, :role3 do
+ map_role(:role3, 'SomeRoleConstantName', initialize_the_object_to_play)
+end
+```
+
+This block will be called _after_ the default initialization is done.
+
## Defining behaviors for roles
Behaviors for your roles are easily defined just like you define a method. Provide your role a block and define methods there.
```ruby
@@ -864,10 +874,10 @@
## How to read this code
If you use this library, it's important to understand it.
-As much as possible, when you use the Surrounded DSL for creating triggers, roles, initialize methods, and others you'll likely fine the actual method definitions created in a module and then find that module included in your class.
+As much as possible, when you use the Surrounded DSL for creating triggers, roles, initialize methods, and others you'll likely find the actual method definitions created in a module and then find that module included in your class.
This is a design choice which allows you to override any standard behavior more easily.
### Where methods exist and why