diff --git a/lib/rulezilla/dsl.rb b/lib/rulezilla/dsl.rb index e74aa4d..9d8d0b3 100644 --- a/lib/rulezilla/dsl.rb +++ b/lib/rulezilla/dsl.rb @@ -51,14 +51,14 @@ def mandatory_attributes def apply(record = {}) result_node = trace(record).last - result_node.nil? ? nil : result_node.result(record_klass_instance(record)) + result_node&.result(record_klass_instance(record)) end def all(record = {}) validate_missing_attributes(record) result_node = tree.find_all(record_klass_instance(record)) - result_node.nil? ? nil : result_node.map { |node| node.result(record_klass_instance(record)) } + result_node&.map { |node| node.result(record_klass_instance(record)) } end def results(record = nil)