Class: FactoryFactoryGirl::Configuration
- Inherits:
-
Object
- Object
- FactoryFactoryGirl::Configuration
- Defined in:
- lib/factory_factory_girl/configuration.rb
Instance Attribute Summary collapse
-
#rails_options ⇒ Object
Returns the value of attribute rails_options.
-
#rules ⇒ Object
Returns the value of attribute rules.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #match(pattern, value: nil, function: nil) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
14 15 16 17 |
# File 'lib/factory_factory_girl/configuration.rb', line 14 def initialize @rules = [] = {} end |
Instance Attribute Details
#rails_options ⇒ Object
Returns the value of attribute rails_options.
12 13 14 |
# File 'lib/factory_factory_girl/configuration.rb', line 12 def end |
#rules ⇒ Object
Returns the value of attribute rules.
12 13 14 |
# File 'lib/factory_factory_girl/configuration.rb', line 12 def rules @rules end |
Instance Method Details
#match(pattern, value: nil, function: nil) ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/factory_factory_girl/configuration.rb', line 19 def match(pattern, value: nil, function: nil) raise "Need to give attribute or process" if value.nil? && function.nil? if value rules << { pattern: pattern, value: value } else rules << { pattern: pattern, function: function } end end |