Class: Reflekt::Rule
- Inherits:
-
Object
- Object
- Reflekt::Rule
- Defined in:
- lib/rule.rb
Direct Known Subclasses
ArrayRule, BooleanRule, FloatRule, IntegerRule, NullRule, ObjectRule, StringRule
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#random ⇒ Dynamic
Each rule provides a random example that matches the rule’s boundaries.
-
#result ⇒ Hash
Each rule provides results.
-
#test(value) ⇒ Boolean
Each rule validates a value with its boundaries.
-
#train(meta) ⇒ Object
Each rule trains on metadata to determine its boundaries.
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
17 18 19 |
# File 'lib/rule.rb', line 17 def type @type end |
Instance Method Details
#random ⇒ Dynamic
Each rule provides a random example that matches the rule’s boundaries.
50 51 |
# File 'lib/rule.rb', line 50 def random() end |
#result ⇒ Hash
Each rule provides results.
41 42 43 |
# File 'lib/rule.rb', line 41 def result() {} end |
#test(value) ⇒ Boolean
Each rule validates a value with its boundaries.
33 34 |
# File 'lib/rule.rb', line 33 def test(value) end |
#train(meta) ⇒ Object
Each rule trains on metadata to determine its boundaries.
24 25 |
# File 'lib/rule.rb', line 24 def train() end |