You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
notahat edited this page Aug 23, 2010
·
2 revisions
User.blueprint do
username { "user#{serial_number}" }
end
- Abbreviate to sn
- Returns a string, four digits
Serial Numbers and Inheritance
Serial numbers for subclasses are pulled from the parent class to avoid clashes.
ParentClass.blueprint do
name { "Parent #{sn}" }
end
ChildClass.blueprint do
name { "Child #{sn}" }
end
ParentClass.make # "Parent 0001"
ChildClass.make # "Child 0002"
ParentClass.make # "Parent 0003"