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 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.
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 ## 2 # Setups up a connection to a data-store 3 # 4 # @param name<Symbol> a name for the context, defaults to :default 5 # @param uri_or_options<Hash{Symbol => String}, Addressable::URI, String> 6 # connection information 7 # 8 # @return <Repository> the resulting setup repository 9 # 10 # @raise <ArgumentError> "+name+ must be a Symbol, but was..." indicates that 11 # an invalid argument was passed for name<Symbol> 12 # @raise <ArgumentError> "+uri_or_options+ must be a Hash, URI or String, but was..." 13 # indicates that connection information could not be gleaned from the given 14 # uri_or_options<Hash, Addressable::URI, String> 15 # - 16 # @api public 17 def self.setup(name, uri_or_options) 18 raise ArgumentError, "+name+ must be a Symbol, but was #{name.class}", caller unless Symbol === name 19 ...
For more information about the YARD documentation style, see lsegal’s YARD repo on github.com.