= propertybuilder

* http://propertybuilder.rubyforge.org

== DESCRIPTION:

Property Builder is a small library for building chains of symbols that will silently fail on nil. This is meant as an alternative to Object#andand and the ilk. This is mostly a theoretical approach, meant to encourage discussion.

== FEATURES/PROBLEMS:

Two main components:

Object#is to build a PropertyBuilder chain

Object#build_on to build the PropertyBuilder on the object and return the specified property

== SYNOPSIS:

class TestClass
attr_accessor :attachment
end

class TestAttachment
def a_method(an_argument="argument")
an_argument
end
end

@test = TestClass.new
@test.attachment = TestAttachment.new
# same as @test.attachment.a_method, but will fail silently if @test.attachment is nil
@test.build_on(is(:attachment, :a_method))
# same as @test.attachment.a_method("test_argument")
@test.build_on(is(:attachment, [:a_method, "test_argument"]))

== REQUIREMENTS:

ActiveSupport

== INSTALL:

gem install propertybuilder

== LICENSE:

(The MIT License)

Copyright (c) 2008 FIX

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.