Module: FactoryHero
- Defined in:
- lib/factory_hero.rb,
lib/factory_hero/version.rb
Constant Summary collapse
- VERSION =
"1.0.0"
Class Method Summary collapse
- .build(klass_or_symbol, attrs = {}) ⇒ Object
- .clear! ⇒ Object
- .configuration ⇒ Object
- .define_factory(klass_or_symbol, options = {}, &block) ⇒ Object
Class Method Details
.build(klass_or_symbol, attrs = {}) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/factory_hero.rb', line 21 def self.build klass_or_symbol, attrs = {} symbol = klass_or_symbol.symbolize factory = configuration.load_factory symbol factory.build attrs end |
.clear! ⇒ Object
28 29 30 |
# File 'lib/factory_hero.rb', line 28 def self.clear! configuration.clear! end |
.configuration ⇒ Object
11 12 13 |
# File 'lib/factory_hero.rb', line 11 def self.configuration @@configuration ||= Configuration.new end |