Module: Vedeu::DSL::Geometry::ClassMethods
- Defined in:
- lib/vedeu/dsl/geometry.rb
Overview
When Vedeu::DSL::Geometry is included in a class, the methods within this module are included as class methods on that class.
Instance Method Summary collapse
Instance Method Details
#geometry(name = nil, &block) ⇒ Vedeu::Geometries::Geometry
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/vedeu/dsl/geometry.rb', line 27 def geometry(name = nil, &block) # Alternative implementation which treats `Vedeu.geometry` # as `Vedeu.geometries` if no name or block is given. # # if name && block_given? # Vedeu::Geometries::Geometry.build(name: name, &block).store # # else # Vedeu.geometries # # end fail Vedeu::Error::MissingRequired unless name fail Vedeu::Error::RequiresBlock unless block_given? Vedeu::Geometries::Geometry.build(name: name, &block).store end |