rubyx/lib/mom/truth_check.rb

18 lines
391 B
Ruby
Raw Normal View History

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
#
class TruthCheck < Check
attr_reader :condition
2017-08-30 16:21:13 +02:00
def initialize(condition)
@condition = condition
2017-08-30 16:21:13 +02:00
end
end
end