Module: Manufacturable::Factory
- Included in:
- ObjectFactory
- Defined in:
- lib/manufacturable/factory.rb
Instance Method Summary collapse
- #build(key, *args) ⇒ Object
- #build_all(key, *args) ⇒ Object
- #build_many(key, *args) ⇒ Object
- #build_one(key, *args) ⇒ Object
- #builds?(key) ⇒ Boolean
- #manufactures(klass) ⇒ Object
Instance Method Details
#build(key, *args) ⇒ Object
9 10 11 12 13 |
# File 'lib/manufacturable/factory.rb', line 9 def build(key, *args) return if @type.nil? Builder.build(@type, key, *args) end |
#build_all(key, *args) ⇒ Object
25 26 27 28 29 |
# File 'lib/manufacturable/factory.rb', line 25 def build_all(key, *args) return [] if @type.nil? Builder.build_all(@type, key, *args) end |
#build_many(key, *args) ⇒ Object
21 22 23 |
# File 'lib/manufacturable/factory.rb', line 21 def build_many(key, *args) build_all(key, *args) end |
#build_one(key, *args) ⇒ Object
15 16 17 18 19 |
# File 'lib/manufacturable/factory.rb', line 15 def build_one(key, *args) return if @type.nil? Builder.build_one(@type, key, *args) end |
#builds?(key) ⇒ Boolean
31 32 33 |
# File 'lib/manufacturable/factory.rb', line 31 def builds?(key) Builder.builds?(@type, key) end |
#manufactures(klass) ⇒ Object
5 6 7 |
# File 'lib/manufacturable/factory.rb', line 5 def manufactures(klass) @type = klass end |