forked from ginty/cranky
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now allows parameter passing to factory methods
- Loading branch information
Ginty
committed
May 23, 2010
1 parent
f72a080
commit 340b093
Showing
4 changed files
with
17 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ class User | |
attr_accessor :role | ||
attr_accessor :email | ||
attr_accessor :unique | ||
attr_accessor :argument_received | ||
|
||
def save | ||
@saved = true | ||
|
@@ -46,11 +47,13 @@ def user_manually | |
end | ||
|
||
def user_by_define | ||
define :class => :user, | ||
:name => "Fred", | ||
:role => :user, | ||
:unique => "value#{n}", | ||
:email => "[email protected]" | ||
u = define :class => :user, | ||
:name => "Fred", | ||
:role => :user, | ||
:unique => "value#{n}", | ||
:email => "[email protected]" | ||
u.argument_received = true if options[:argument_supplied] | ||
u | ||
end | ||
alias :user :user_by_define | ||
|
||
|