Module: Vedeu::DSL::Geometry::SingletonMethods
- Defined in:
- lib/vedeu/dsl/geometry.rb
Overview
Provide additional behaviour as singleton methods to the including class or module.
Instance Method Summary collapse
Instance Method Details
#geometry(name = nil, &block) ⇒ Vedeu::Geometries::Geometry
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/vedeu/dsl/geometry.rb', line 23 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 raise Vedeu::Error::MissingRequired unless name raise Vedeu::Error::RequiresBlock unless block_given? Vedeu::Geometries::Geometry.build(name: name, &block).store end |