Skip to content

Instantly share code, notes, and snippets.

@bguthrie
Created February 27, 2011 04:00
Show Gist options
  • Save bguthrie/845892 to your computer and use it in GitHub Desktop.
Save bguthrie/845892 to your computer and use it in GitHub Desktop.
Several method signatures used in a DSL like ActiveRecord, somewhat simplified.
# 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