No commit activity in last 3 years
No release in over 3 years
Extensions to make Hashie more ideal for building data mappers
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 0.9.2
~> 2.5

Runtime

>= 1.2.0
 Project Readme

Hashie Data Mapper Build Status Dependency Status

An extension to the Hashie Ruby Gem for Working with Data Mappers.

This is hopefully just a temporary project, pending the merge into Hashie of this pull request: hashie/hashie#131

Installation

Add this to your Gemfile:

gem 'hashie_data_mapper', '~> 0.1.4'

Usage

require 'hashie'
require 'hashie_data_mapper'

class Person < Trash
  include HashieDataMapper::IgnoreUndeclared
    
  property :first_name
  property :last_name
 end
 
user_data = {
  :first_name => 'Freddy',
  :last_name => 'Nostrils',
  :email => 'freddy@example.com'
}

p = Person.new(user_data) # 'email' is silently ignored

p.first_name # => 'Freddy'
p.last_name  # => 'Nostrils'
p.email      # => NoMethodError