Module: HasFixtures::Base::ClassMethods
- Defined in:
- lib/has_fixtures/base.rb
Instance Method Summary collapse
- #default_fauxture_name ⇒ Object
- #fixture(name = default_fauxture_name, &blk) ⇒ Object (also: #fix)
- #generate(name = default_fauxture_name, attributes = {}) ⇒ Object (also: #gen)
- #generate_attributes(name = default_fauxture_name) ⇒ Object (also: #gen_attrs)
- #make(name = default_fauxture_name, attributes = {}) ⇒ Object
- #pick(name = default_fauxture_name) ⇒ Object
Instance Method Details
#default_fauxture_name ⇒ Object
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 |