Project

somewhere

0.0
No commit activity in last 3 years
No release in over 3 years
Serialized address class for use with Rails models.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 1.0.0
 Project Readme

Somewhere

This gem was developed for use in a number of Rails projects. I tend to use addresses all over the place, so this gem handles all the nitpicky class level details for an address object.

Be sure to check out nybblr.com for other Rails goodies, and if you're looking for more of my gems (when I get around to it!) surf around my GitHub repos.

Subsection A: Why Somewhere?

If you're not somewhere, you're nowhere. That's a different gem.

Usage

From your ActiveRecord model, simply call the address method:

class User < ActiveRecord::Base
	# Example usages
	address

	address :billing

	address :billing, :postal_code => :zip, :include_prefix => false

end

Once you instantiate an Address object, you can convert to a hash:

address.to_hash
address.to_hash :exclude => [:country]

Or you can convert to a string:

address.to_s
address.to_s :country => false
address.to_s :delimiter => "\n"
address.to_s :multiline