Class: Drymm::Shapes::Types::Type Abstract

Inherits:
Node
  • Object
show all
Extended by:
Branch, Summarize
Defined in:
lib/drymm/shapes/types.rb

Overview

This class is abstract.

Abstract node branch class for shapes of Dry::Types

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Branch

auto_tuple, auto_tuple!, coerce_tuple, retuple

Methods inherited from Node

type_enum, type_identifier

Methods included from ASTMethods

#to_ast

Methods included from JSONMethods

#to_json

Class Method Details

.compiler(registry = compiler_registry()) ⇒ ::Dry::Logic::RuleCompiler

Returns:

  • (::Dry::Logic::RuleCompiler)


26
27
28
# File 'lib/drymm/shapes/types.rb', line 26

def self.compiler(registry = compiler_registry())
  ::Dry::Types::Compiler.new(registry)
end

.compiler_registry::Dry::Logic::Predicates

Returns:

  • (::Dry::Logic::Predicates)


21
22
23
# File 'lib/drymm/shapes/types.rb', line 21

def self.compiler_registry
  ::Dry::Types
end

.namespaceObject



16
17
18
# File 'lib/drymm/shapes/types.rb', line 16

def self.namespace
  Types
end

Instance Method Details

#compileObject



30
31
32
# File 'lib/drymm/shapes/types.rb', line 30

def compile
  self.class.compiler.call(to_ast)
end