Class: Reflekt::Rule

Inherits:
Object
  • Object
show all
Defined in:
lib/rule.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



17
18
19
# File 'lib/rule.rb', line 17

def type
  @type
end

Instance Method Details

#randomDynamic

Each rule provides a random example that matches the rule’s boundaries.

Returns:

  • (Dynamic)

    A random value.



50
51
# File 'lib/rule.rb', line 50

def random()
end

#resultHash

Each rule provides results.

Returns:

  • (Hash)


41
42
43
# File 'lib/rule.rb', line 41

def result()
  {}
end

#test(value) ⇒ Boolean

Each rule validates a value with its boundaries.

Parameters:

  • value (Dynamic)

Returns:

  • (Boolean)

    Whether the value passes or fails.



33
34
# File 'lib/rule.rb', line 33

def test(value)
end

#train(meta) ⇒ Object

Each rule trains on metadata to determine its boundaries.

Parameters:



24
25
# File 'lib/rule.rb', line 24

def train(meta)
end