diff --git a/lib/image_vise/pipeline.rb b/lib/image_vise/pipeline.rb index 4d8ee9b..96a2c4d 100644 --- a/lib/image_vise/pipeline.rb +++ b/lib/image_vise/pipeline.rb @@ -27,14 +27,12 @@ def empty? @ops.empty? end - if RUBY_VERSION.start_with?("2.6") - def method_missing(method_name, *args, &blk) - operator_builder = ImageVise.operator_from(method_name) + def method_missing(method_name, args = {}, &blk) + operator_builder = ImageVise.operator_from(method_name) + + if RUBY_VERSION.start_with?("2.6") # TODO: remove after dropping Ruby 2.6 support self << operator_builder.new(*args) - end - else - def method_missing(method_name, args = {}, &blk) - operator_builder = ImageVise.operator_from(method_name) + else self << operator_builder.new(**args) end end