Created
February 27, 2011 04:00
-
-
Save bguthrie/845892 to your computer and use it in GitHub Desktop.
Several method signatures used in a DSL like ActiveRecord, somewhat simplified.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# def initialize(attributes = {}) | |
Pirate.new :name => "Greenbeard", :ship => "The Queen Anne's Renegotiation" | |
# def has_many(of_what, options = {}) | |
has_many :crew_members, :class_name => "Pirate", :foreign_key => "captain_id" | |
# def validates_presence_of(*arrrrrgs) | |
validates_presence_of :parrot, :peg_leg, :blank => false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment