Top Level Namespace
Defined Under Namespace
Modules: Fabrication, FabricationMethods Classes: Fabricate
Instance Method Summary collapse
- #Fabricate(name, overrides = {}, &block) ⇒ Object
-
#Fabricator(name, options = {}, &block) ⇒ Object
rubocop:disable Naming/MethodName.
- #with_ivars(fabricator) ⇒ Object
Instance Method Details
#Fabricate(name, overrides = {}, &block) ⇒ Object
65 66 67 |
# File 'lib/fabrication.rb', line 65 def Fabricate(name, overrides = {}, &block) Fabricate.create(name, overrides, &block) end |
#Fabricator(name, options = {}, &block) ⇒ Object
rubocop:disable Naming/MethodName
61 62 63 |
# File 'lib/fabrication.rb', line 61 def Fabricator(name, = {}, &block) Fabrication.manager.register(name, , &block) end |
#with_ivars(fabricator) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/rails/generators/fabrication/cucumber_steps/templates/fabrication_steps.rb', line 7 def with_ivars(fabricator) @they = yield fabricator model = @they.last.class.to_s.underscore instance_variable_set("@#{model.pluralize}", @they) instance_variable_set("@#{model.singularize}", @they.last) Fabrication::Cucumber::Fabrications[model.singularize.gsub(/\W+/, '_').downcase] = @they.last end |