Module: Machinist::Blueprints::ClassMethods
- Defined in:
- lib/machinist/blueprints.rb
Instance Method Summary collapse
- #blueprint(name = :master, &blueprint) ⇒ Object
- #clear_blueprints! ⇒ Object
- #named_blueprints ⇒ Object
Instance Method Details
#blueprint(name = :master, &blueprint) ⇒ Object
9 10 11 12 13 |
# File 'lib/machinist/blueprints.rb', line 9 def blueprint(name = :master, &blueprint) @blueprints ||= {} @blueprints[name] = blueprint if block_given? @blueprints[name] end |
#clear_blueprints! ⇒ Object
19 20 21 |
# File 'lib/machinist/blueprints.rb', line 19 def clear_blueprints! @blueprints = {} end |
#named_blueprints ⇒ Object
15 16 17 |
# File 'lib/machinist/blueprints.rb', line 15 def named_blueprints @blueprints.reject{|name,_| name == :master }.keys end |