Class: FactoryGirl::Syntax::Default::ModifyDSL

Inherits:
Object
  • Object
show all
Defined in:
lib/factory_girl/syntax/default.rb

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) run(block)



68
69
70
# File 'lib/factory_girl/syntax/default.rb', line 68

def self.run(block)
  new.instance_eval(&block)
end

Instance Method Details

- (Object) factory(name, options = {}, &block)



62
63
64
65
66
# File 'lib/factory_girl/syntax/default.rb', line 62

def factory(name, options = {}, &block)
  factory = FactoryGirl.factory_by_name(name)
  proxy = FactoryGirl::DefinitionProxy.new(factory.definition.overridable)
  proxy.instance_eval(&block)
end