Skip to content

Instantly share code, notes, and snippets.

[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
1f3f5b7af97dfdf466ad0f31074aeb7b4cd4384fad82fad8884f00c6dde7c051
8743185cc80273849310dd4be0467dd5be8cf8ecf74ebd92ef150a4ce7a65d91
@mjalvarez
mjalvarez / chain-of-responsibility.rb
Created January 31, 2017 14:22 — forked from martindemello/chain-of-responsibility.rb
chain of responsibility example in ruby
class PurchaseApprover
# Implements the chain of responsibility pattern. Does not know anything
# about the approval process, merely whether the current handler can approve
# the request, or must pass it to a successor.
attr_reader :successor
def initialize successor
@successor = successor
end