Module: Blueprints::Extensions::Blueprintable::ClassMethods
- Defined in:
- lib/blueprints/extensions.rb
Instance Method Summary collapse
Instance Method Details
#blueprint(attributes) ⇒ Object #blueprint(name, attributes = {}) ⇒ Blueprints::Blueprint
33 34 35 36 37 38 39 40 41 |
# File 'lib/blueprints/extensions.rb', line 33 def blueprint(*args) if Blueprints::Context.current attrs = args. define_blueprint(args.first || Blueprints::Buildable.infer_name(attrs) || name.underscore, attrs) else objects = args.collect { |attrs| blueprint_object(attrs) } args.size == 1 ? objects.first : objects end end |