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
haskeyword - Hooks
- Hooks, AKA Callbacks, allow you to "advise other methods" by running methods before or after calling other methods.
- Misc. Features
- Paranoia, Single Table Inheritance, and Multiple Repositories.
- 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.
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 ...
For more information about the YARD documentation style, see the YARD Getting Started document.