class Pickle::Adapter::Fabrication
fabrication adapter
Public Class Methods
factories()
click to toggle source
# File lib/pickle/adapter.rb, line 145 def self.factories if defined? ::Fabrication ::Fabrication.manager.load_definitions if ::Fabrication.manager.schematics.empty? ::Fabrication.manager.schematics.map { |name, klass| new([name, klass]) } else [] end end
new(factory)
click to toggle source
# File lib/pickle/adapter.rb, line 154 def initialize(factory) if defined? ::Fabrication @klass, @name = factory[1].klass, factory[0].to_s end end
Public Instance Methods
create(attrs = {})
click to toggle source
# File lib/pickle/adapter.rb, line 160 def create(attrs = {}) if defined? ::Fabrication Fabricate(@name.to_sym, attrs) end end