You can do the following: (unlimited amount of arguments, kinda have to use a Hash)
# definition
def pipeline(*args, &block)
# your logic here
end
# usage
dept_id = 1
result = Project.pipeline(dept_id: dept_id) do
match dept_id: dept_id
end
Or you can use named arguments, if you know how many arguments you need to execute the DSL:
# definition
def pipeline(dept_id, needed_variable, default_variable = false, &block)
# your logic here
end
# usage
dept_id = 1
result = Project.pipeline(dept_id, other_variable) do
match dept_id: dept_id
end