Class: Drymm::Shapes::Logic::Grouping

Inherits:
Rule
  • Object
show all
Defined in:
lib/drymm/shapes/logic.rb

Overview

See Also:

  • Dry::Logic::Operations::Binary

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Rule

compiler, compiler_registry, namespace

Methods included from Branch

#auto_tuple, #auto_tuple!, #coerce_tuple, #retuple

Methods inherited from Node

type_enum, type_identifier

Methods included from ASTMethods

#compile

Methods included from JSONMethods

#to_json

Class Method Details

.coerce_tuple(type, rules) ⇒ Object



76
77
78
# File 'lib/drymm/shapes/logic.rb', line 76

def self.coerce_tuple((type, rules))
  { type: type, rules: rules }
end

Instance Method Details

#to_astObject



72
73
74
# File 'lib/drymm/shapes/logic.rb', line 72

def to_ast
  [type, rules.map(&:to_ast)]
end