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

Defined in:
lib/vedeu/dsl/geometry.rb

Overview

Provide additional behaviour as instance methods.

Instance Method Summary collapse

Instance Method Details

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

Parameters:

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

    The name of the model or target model to act upon. May default to ‘Vedeu.focus`.

  • block (Proc)

Returns:

Raises:

See Also:



54
55
56
57
58
59
60
# File 'lib/vedeu/dsl/geometry.rb', line 54

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

  model_name = name ? name : model.name

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