adomokos/light-service — pull request #39 by adomokos (2014-05-22 03:32:30+00:00)
Title: Moving the `promises` and `expects` accessors to Context

The concept of `self.order` does not make much sense. Where did that variable or attribute reader come from? It makes a ton more sense to ask the Context itself to provide the accessors for the promised and expected keys.

I had to write this before:
```ruby
class AddsOneAction
include LightService::Action
expects :number
promises :number

executed do |context|
number = self.number
number += 1

self.number = number
end
end
```

And now it's only this:
```ruby
class AddsOneAction
include LightService::Action
expects :number
promises :number

executed do |context|
context.number += 1
end
end
```

It feels so much better to ask the context for values and not rely on some kind of method hanging on `self` not knowing where it came from.