Module: Drymm

Extended by:
Container
Includes:
Dry::Core::Constants
Defined in:
lib/drymm.rb,
lib/drymm/shapes.rb,
lib/drymm/version.rb,
lib/drymm/container.rb,
lib/drymm/inflector.rb,
lib/drymm/shapes/fn.rb,
lib/drymm/shapes/node.rb,
lib/drymm/shapes/const.rb,
lib/drymm/shapes/logic.rb,
lib/drymm/shapes/types.rb,
lib/drymm/repos/fn_repo.rb,
lib/drymm/shapes/branch.rb,
lib/drymm/repos/rules_repo.rb,
lib/drymm/repos/types_repo.rb,
lib/drymm/shapes/summarize.rb,
lib/drymm/shapes/ast_methods.rb,
lib/drymm/shapes/atomic_type.rb,
lib/drymm/shapes/json_methods.rb,
lib/drymm/shapes/sum_enclosure.rb

Overview

# Drym¹m² is for (¹)meta (²)mapping

Drymm represents entities provided by Dry::Logic Dry::Types as a Dry::Struct classes under a Shapes namespace.

The core feature of Drymm::Shapes is an ability to cast an AST produced by that entities and structurize it for the following serialization (for example, into JSON). Also it provides an interface to load serialized data and compile it back to the Type or Logic entity.

The casts perform by declaring expecting shapes under a specific Shapes::Branch namespace without any conditional code but with a significant amount of recursion. Declared shapes composed into Dry::Struct::Sum which are in front of the casting behaviour.

Defined Under Namespace

Modules: Container, FnRepo, RulesRepo, Shapes, TypesRepo Classes: Inflector

Constant Summary collapse

VERSION =
"0.2.1"

Class Method Summary collapse

Methods included from Container

extended

Class Method Details

.[](key) ⇒ mixed

Parameters:

  • key (String, Symbol)

Returns:

  • (mixed)


# File 'lib/drymm.rb', line 68

.inflectorDrymm::Inflector

Returns:



57
58
59
# File 'lib/drymm.rb', line 57

def inflector
  loader.inflector
end

.resolve(key) ⇒ mixed

Parameters:

  • key (String, Symbol)

Returns:

  • (mixed)


76
# File 'lib/drymm.rb', line 76

merge Drymm::RulesRepo, namespace: :rules