Skip to content
/ mash Public
forked from mbleigh/mash

Mash is a Hash with the ability to read, write, and test for the presence of arbitrary attributes using method calls.

Notifications You must be signed in to change notification settings

swerling/mash

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

= Mash (Mocking Hash)

http://github.com/mbleigh/mash

== DESCRIPTION:

Mash is an extended Hash that gives simple pseudo-object functionality
that can be built from hashes and easily extended. It is designed to
be used in RESTful API libraries to provide easy object-like access 
to JSON and XML parsed hashes.

== SYNOPSIS:
  
  mash = Mash.new
  mash.name? # => false
  mash.name # => nil
  mash.name = "My Mash"
  mash.name # => "My Mash"
  mash.name? # => true
  mash.inspect # => <Mash name="My Mash">
  
  mash = Mash.new
  # use bang methods for multi-level assignment
  mash.author!.name = "Michael Bleigh"
  mash.author # => <Mash name="Michael Bleigh">

== INSTALL:

Gem:

Mash is hosted on the GitHub gem repository, so if you haven't already:

  gem sources -a http://gems.github.com/  
  sudo gem install mbleigh-mash
  
Git:

  git clone git://github.com/mbleigh/mash.git
  
== RESOURCES

If you encounter any problems or have ideas for new features 
please report them at the Lighthouse project for Mash: 

http://mbleigh.lighthouseapp.com/projects/10112-mash

== LICENSE:

Copyright (c) 2008 Michael Bleigh (http://mbleigh.com/) 
and Intridea Inc. (http://intridea.com/), released under the MIT license

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.

About

Mash is a Hash with the ability to read, write, and test for the presence of arbitrary attributes using method calls.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%