Class: Reflekt::NullRule
Instance Attribute Summary
Attributes inherited from Rule
Instance Method Summary collapse
-
#initialize ⇒ NullRule
constructor
A new instance of NullRule.
- #random ⇒ Object
- #result ⇒ Object
- #test(value) ⇒ Object
- #train(meta) ⇒ Object
Constructor Details
#initialize ⇒ NullRule
Returns a new instance of NullRule.
6 7 8 |
# File 'lib/rules/null_rule.rb', line 6 def initialize() @type = :null end |
Instance Method Details
#random ⇒ Object
30 31 32 |
# File 'lib/rules/null_rule.rb', line 30 def random() nil end |
#result ⇒ Object
24 25 26 27 28 |
# File 'lib/rules/null_rule.rb', line 24 def result() { :type => @type } end |
#test(value) ⇒ Object
20 21 22 |
# File 'lib/rules/null_rule.rb', line 20 def test(value) value.nil? end |
#train(meta) ⇒ Object
13 14 15 |
# File 'lib/rules/null_rule.rb', line 13 def train() # No need to train as NullMeta is always nil. end |