Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Handle keyword arguments for Ruby 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
kodnin committed Aug 11, 2021
1 parent 14cb0af commit 5caf08c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/image_vise/pipeline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,16 @@ def empty?
@ops.empty?
end

def method_missing(method_name, args = {}, &blk)
operator_builder = ImageVise.operator_from(method_name)
self << operator_builder.new(**args)
if RUBY_VERSION.start_with?("2.6")
def method_missing(method_name, *args, &blk)
operator_builder = ImageVise.operator_from(method_name)
self << operator_builder.new(*args)
end
else
def method_missing(method_name, args = {}, &blk)
operator_builder = ImageVise.operator_from(method_name)
self << operator_builder.new(**args)
end
end

def respond_to_missing?(method_name, *a)
Expand Down

0 comments on commit 5caf08c

Please sign in to comment.