Sha256: 24810b0d757a7e988c42c4074fc77d6813fb61896f79f4b05e6a9b03cc6af126
Contents?: true
Size: 564 Bytes
Versions: 12
Compression:
Stored size: 564 Bytes
Contents
module Machinist # Include this in a class to allow defining blueprints for that class. module Blueprints def self.included(base) base.extend(ClassMethods) end module ClassMethods def blueprint(name = :master, &blueprint) @blueprints ||= {} @blueprints[name] = blueprint if block_given? @blueprints[name] end def named_blueprints @blueprints.reject{|name,_| name == :master }.keys end def clear_blueprints! @blueprints = {} end end end end
Version data entries
12 entries across 12 versions & 7 rubygems