Module: Vedeu::DSL::Geometry::InstanceMethods

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 instance methods on that class.

Instance Method Summary collapse

Instance Method Details

#geometry(name = nil, &block) ⇒ Vedeu::Geometries::Geometry

Parameters:

  • name (String|Symbol) (defaults to: nil)

    The name of the interface; this is already provided when we define the interface or view, setting it here is just mirroring functionality of ClassMethods#geometry.

  • block (Proc)

Returns:

Raises:

See Also:



63
64
65
66
67
68
69
# File 'lib/vedeu/dsl/geometry.rb', line 63

def geometry(name = nil, &block)
  fail Vedeu::Error::RequiresBlock unless block_given?

  model_name = name ? name : model.name

  Vedeu::Geometries::Geometry.build(name: model_name, &block).store
end