Class: Manufacturable::Builder
- Inherits:
-
Object
- Object
- Manufacturable::Builder
- Defined in:
- lib/manufacturable/builder.rb
Class Method Summary collapse
- .build(*args, **kwargs, &block) ⇒ Object
- .build_all(*args, **kwargs, &block) ⇒ Object
- .build_one(*args, **kwargs, &block) ⇒ Object
- .builds?(*args, **kwargs, &block) ⇒ Boolean
Instance Method Summary collapse
Class Method Details
.build(*args, **kwargs, &block) ⇒ Object
6 7 8 |
# File 'lib/manufacturable/builder.rb', line 6 def self.build(*args, **kwargs, &block) self.new(*args, **kwargs, &block).build end |
.build_all(*args, **kwargs, &block) ⇒ Object
14 15 16 |
# File 'lib/manufacturable/builder.rb', line 14 def self.build_all(*args, **kwargs, &block) self.new(*args, **kwargs, &block).build_all end |
.build_one(*args, **kwargs, &block) ⇒ Object
10 11 12 |
# File 'lib/manufacturable/builder.rb', line 10 def self.build_one(*args, **kwargs, &block) self.new(*args, **kwargs, &block).build_one end |
.builds?(*args, **kwargs, &block) ⇒ Boolean
18 19 20 |
# File 'lib/manufacturable/builder.rb', line 18 def self.builds?(*args, **kwargs, &block) self.new(*args, **kwargs, &block).builds? end |
Instance Method Details
#build ⇒ Object
22 23 24 |
# File 'lib/manufacturable/builder.rb', line 22 def build return_first? ? instances.first : instances end |
#build_all ⇒ Object
30 31 32 |
# File 'lib/manufacturable/builder.rb', line 30 def build_all instances end |
#build_one ⇒ Object
26 27 28 |
# File 'lib/manufacturable/builder.rb', line 26 def build_one last_instance end |
#builds? ⇒ Boolean
34 35 36 |
# File 'lib/manufacturable/builder.rb', line 34 def builds? Registrar.registered_keys(type).include?(key) end |