This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
.document | ||
| |
.gitignore | ||
| |
LICENSE | ||
| |
README.md | ||
| |
Rakefile | ||
| |
VERSION.yml | ||
| |
attr-chain.gemspec | ||
| |
lib/ | ||
| |
spec/ |
README.md
attr-chain
attr-chain is for when you're building up a DSL in which you'd like to have attributes
that can be chained together when they're being set.
Its simple and small, you probably aren't interested. I kept on using this pattern and wanted to abstract it away from my other code.
Working example
require 'attr-chain'
class Chainsaw
include AttributeChain
attr_chain :start, :cut
end
>> c = Chainsaw.new
>> c.start
=> nil
>> c.start(:now).cut(:hippy)
>> c.start
=> :now
>> c.cut
=> :hippy
Copyright
Copyright (c) 2009 Ben Schwarz. See LICENSE for details.








