abstract class Crowbar::Rule

Overview

Base class for structure-preserving rule engines. Rules understand specific formats (JSON, YAML, HTTP, DNS) and ensure that the structural framing remains syntactically valid while underlying values are mutated.

Direct Known Subclasses

Defined in:

crowbar/rules/base.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(weight : Float64 = 1.0) #

Instance Method Detail

abstract def apply(context : Context, buffer : Buffer) : Bool #

Applies a structure-preserving transformation to the buffer


abstract def description : String #

abstract def match?(buffer : Buffer) : Bool #

Checks whether the buffer matches the format handled by this rule


abstract def name : String #

def targets(*targets : Symbol) #

Optional target filtering for format rules supporting selective mutation


def weight : Float64 #

def weight=(weight : Float64) #