adomokos/light-service — pull request #25 by padi (2013-08-02 14:40:53+00:00)
Title: Context rewrite.

So one boring day, I rewrote the Context because I've been itching to do so for quite some time now.

I can keep it on my own fork but I just want to get it out there so that I can get feedback:

- `LightService::Context` now inherits from Hash
- breaks the current API:
* from `Context.new(outcome, message, context)` -> `Context.new(context, outcome, message)`
Conflicts:
lib/light-service/context.rb

Why?
- from our usage so far, Context is actually a hash plus extra methods (`failure?`, `skip_all?`)... but mostly a Hash. So why not expose Hash's default methods? Unless there is a good reason to hide the default Hash methods, we should make them available.

- makes the codebase actually shorter by removing `Context#methods` that just delegates to `@context`.

- I could actually make it shorter by removing `Context.make`, since it can be replaced by `Context.new` now. By doing that, we can simply follow Ruby conventions. I can also remove `#context_hash`, but the other pull request for deprecating that method is still pending.