Sha256: dc2e5d53164ae050b759ce92b4ee291f0ff1a2a1897103bbe04218942ef435fb

Contents?: true

Size: 666 Bytes

Versions: 2

Compression:

Stored size: 666 Bytes

Contents

# 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.

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
benschwarz-attr-chain-0.1.0 README.md
benschwarz-attr-chain-0.1.1 README.md