Class: FactoryGirl::Sequence

Inherits:
Object
  • Object
show all
Defined in:
lib/fg-quickgenerate.rb

Constant Summary collapse

SIMPLE_REPLACEMENT =
"#N"

Class Method Summary collapse

Class Method Details

.simple(name, string) ⇒ Object



33
34
35
36
# File 'lib/fg-quickgenerate.rb', line 33

def self.simple(name, string)
  string += SIMPLE_REPLACEMENT unless string.include? SIMPLE_REPLACEMENT
  Sequence.new(name){|n| string.gsub(SIMPLE_REPLACEMENT, n.to_s)}
end