tdantas/usecasing — pull request #5 by junhanamaki (2014-10-02 15:18:03+00:00)
Title: changes

- method before is now called before UseCases set with depends, meaning that the execution order is:

- before -> dependencies -> perform

- it's now possible to set accessors to attributes in context, for example instead of doing context.parameter we can just write parameter, this can be done with class methods:

```
class Case < UseCase::Base
context_reader :books
context_writer :review
context_accessor :comments

def perform
puts books # same as puts context.bookd
self.review = 'Very good' # same as context.review = 'Very good'
# self.comments and comments are also made available
end
end
```

- you can skip the execution flow by invoking skip!, this will interrupt the current UseCase and it's dependencies like stop!, but it will continue with the following UseCases:

```
def perform
skip! if context.to_skip
end
```

- it’s possible to insert a usecase to chain using invoke!:
```
def perform
invoke! AnotherUseCase
end
```