winch

DESCRIPTION:

  • Winch, when you need to have some more control over the data that ActiveResource loads.

FEATURES/PROBLEMS:

  • There seems to be problems if the class inheriting ActiveResource::Base has Mixins with constructors.

SYNOPSIS:

#In the example below a cat will default to clean fur on it's first leg, and dirty fur on all the other legs unless 
#it is explicitly defined in the xml

class Cat < ActiveResource::Base
  must_have 'tail', :faux => "invalid tail"

must_have ‘legs’, :default => [=> ‘groomed’, ‘fur’ => ‘clean’]

end

class Cat::Leg < ActiveResource::Base
  must_have 'paws', :faux => "invalid tail"
  must_have 'fur', :default => 'dirty'
end

REQUIREMENTS:

  • NONE

INSTALL:

  • sudo gem install winch

LICENSE:

winch: when you need to have some more control over the data that ActiveResource loads. Copyright © 2009 Vanson Samuel

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.