Module: FactoryGirl::Syntax::Sham::Sham

Defined in:
lib/factory_girl/syntax/sham.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.method_missing(name, *args, &block) ⇒ Object


27
28
29
30
31
32
33
34
# File 'lib/factory_girl/syntax/sham.rb', line 27

def self.method_missing(name, *args, &block)
  if block_given?
    start_value = args.first
    FactoryGirl.register_sequence(Sequence.new(name, start_value || 1, &block))
  else
    FactoryGirl.sequence_by_name(name).next
  end
end

.name(&block) ⇒ Object

overrides name on Module


37
38
39
# File 'lib/factory_girl/syntax/sham.rb', line 37

def self.name(&block)
  method_missing('name', &block)
end