Class: Reflekt::NullRule

Inherits:
Rule
  • Object
show all
Defined in:
lib/rules/null_rule.rb

Instance Attribute Summary

Attributes inherited from Rule

#type

Instance Method Summary collapse

Constructor Details

#initializeNullRule

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

#randomObject



30
31
32
# File 'lib/rules/null_rule.rb', line 30

def random()
  nil
end

#resultObject



24
25
26
27
28
# File 'lib/rules/null_rule.rb', line 24

def result()
  {
    :type => @type
  }
end

#test(value) ⇒ Object

Parameters:

  • value (NilClass)


20
21
22
# File 'lib/rules/null_rule.rb', line 20

def test(value)
  value.nil?
end

#train(meta) ⇒ Object

Parameters:



13
14
15
# File 'lib/rules/null_rule.rb', line 13

def train(meta)
  # No need to train as NullMeta is always nil.
end