This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _CHECK_(yield_stack, options, &block) | |
# Proc#[] は Proc#call の別名で、これを利用すると Hash#[] と同じように呼び出せるようになります | |
datastore = options[:_ARGUMENT_] ? @root_control.send(options[:_ARGUMENT_]) : proc {|key| send(key) } | |
# いずれかが真のときに true ということならここも any? が使えます | |
result = options.any? do |condition, value| | |
case condition | |
#指定されたデータと値がイコールかどうか | |
when :equal | |
value.any?{|key, val| datastore[key] == val} | |
#指定されたデータと値がイコールでない場合 |