2017-09-04 20:00:08 +02:00
|
|
|
require_relative "check"
|
|
|
|
|
2017-08-30 16:21:13 +02:00
|
|
|
module Mom
|
|
|
|
|
|
|
|
# The funny thing about the ruby truth is that is is anything but false or nil
|
|
|
|
#
|
|
|
|
# To implement the normal ruby logic, we check for false or nil and jump
|
|
|
|
# to the false branch. true_block follows implicitly
|
|
|
|
#
|
2017-09-04 20:00:08 +02:00
|
|
|
class TruthCheck < Check
|
|
|
|
attr_reader :condition
|
2017-08-30 16:21:13 +02:00
|
|
|
|
2017-09-04 20:00:08 +02:00
|
|
|
def initialize(condition)
|
|
|
|
@condition = condition
|
2017-08-30 16:21:13 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|