Documentation

API
The API for the current gem release.
Why DataMapper?
If you haven't read this yet, you should, right now!
Getting Started
A whirlwind tour of DM. This is the place to start if you haven't used the library before.
Common installation issues
Troubleshooting installation, with instructions for specific platforms.
Properties
Properties declared in your model map to the fields in the database.
Creating, Saving, Updating and Destroying Records
Obviously you're going to be doing a lot of this :)
Validations
Auto-validations, manual validations, contextual validations
Finding and Counting Records
There are lots of nice ways to find records.
Associations
Models can be associated to each other in various ways using the has keyword
Hooks
Hooks, AKA Callbacks, allow you to "advise other methods" by running methods before or after calling other methods.
Misc. Features
Paranoia, Timezone Handling, Single Table Inheritance, and Multiple Repositories.
Working with Legacy Schemas
Adapting data-store naming conventions to your own property names.
Common Pitfalls
Solutions and work-arounds to common problems.
More
Plugins galore for DataMapper.

Documentarians Wanted!

Want to help DataMapper, but don't know where to start? A great way to contribute is to help out in the documentation effort.

If you know of some interesting and useful functionality that isn't covered on datamapper.org, just go ahead and fork datamapper.github.com, send us a pull request, and we'll merge it as fast as we can. If you want to contribute more, we can give you commit access to the repository right after that.

If you find some undocumented piece of code inside dm-core or any of the other datamapper repositories, we would greatly appreciate it if you take the time to read and understand that code, fork the repository, add the necessary docs and send us a pull request. Again, we'll try to merge them as fast as we can.

Documentation Style

DataMapper uses the YARD standard for RDoc documentation. Here's a brief sample from the internals of DM-Core:

 1 # Setups up a connection to a data-store
 2 #
 3 # @param [Symbol] name
 4 #   a name for the context, defaults to :default
 5 # @param [Hash(Symbol => String), Addressable::URI, String] uri_or_options
 6 #   connection information
 7 #
 8 # @return [DataMapper::Adapters::AbstractAdapter]
 9 #   the resulting setup adapter
10 #
11 # @raise [ArgumentError] "+name+ must be a Symbol, but was..."
12 #   indicates that an invalid argument was passed for name[Symbol]
13 # @raise [ArgumentError] "+uri_or_options+ must be a Hash, URI or String, but was..."
14 #   indicates that connection information could not be gleaned from
15 #   the given uri_or_options[Hash, Addressable::URI, String]
16 #
17 # @api public
18 def self.setup(name, uri_or_options)
19   raise ArgumentError, "+name+ must be a Symbol, but was #{name.class}", caller unless Symbol === name
20   #...
21 end

For more information about the YARD documentation style, see the YARD Getting Started document.