Module: HasFixtures::Base::ClassMethods

Defined in:
lib/has_fixtures/base.rb

Instance Method Summary collapse

Instance Method Details

#default_fauxture_nameObject



36
37
38
# File 'lib/has_fixtures/base.rb', line 36

def default_fauxture_name
  :default
end

#fixture(name = default_fauxture_name, &blk) ⇒ Object Also known as: fix



8
9
10
# File 'lib/has_fixtures/base.rb', line 8

def fixture(name = default_fauxture_name, &blk)
  Sweatshop.add(self, name, &blk)
end

#generate(name = default_fauxture_name, attributes = {}) ⇒ Object Also known as: gen



14
15
16
17
# File 'lib/has_fixtures/base.rb', line 14

def generate(name = default_fauxture_name, attributes = {})
  name, attributes = default_fauxture_name, name if name.is_a? Hash
  Sweatshop.create(self, name, attributes)
end

#generate_attributes(name = default_fauxture_name) ⇒ Object Also known as: gen_attrs



21
22
23
# File 'lib/has_fixtures/base.rb', line 21

def generate_attributes(name = default_fauxture_name)
  Sweatshop.attributes(self, name)
end

#make(name = default_fauxture_name, attributes = {}) ⇒ Object



27
28
29
30
# File 'lib/has_fixtures/base.rb', line 27

def make(name = default_fauxture_name, attributes = {})
  name, attributes = default_fauxture_name, name if name.is_a? Hash
  Sweatshop.make(self, name, attributes)
end

#pick(name = default_fauxture_name) ⇒ Object



32
33
34
# File 'lib/has_fixtures/base.rb', line 32

def pick(name = default_fauxture_name)
  Sweatshop.pick(self, name)
end