Skip to content
notahat edited this page Aug 23, 2010 · 7 revisions

A blueprint specifies how to construct an object of a class by providing values for its attributes.

Post.blueprint do
  title { "A Post" }
  body  { "Lorem ipsum..." }
end

More to come…

Serial Numbers

If you’ve got an attribute that needs to be unique, Machinist gives you a serial number for the object being created that you can insert into the attribute.

User.blueprint do
  username { "user#{sn}" }
end

Learn more about Serial Numbers.

Clone this wiki locally