提交 61fef761 编写于 作者: C Carlos Antonio da Silva

Remove argument that is accessible as attribute

上级 b8c6c084
......@@ -17,8 +17,8 @@ def check_validity!
raise ArgumentError, "Either :with or :without must be supplied (but not both)"
end
check_options_validity(options, :with)
check_options_validity(options, :without)
check_options_validity :with
check_options_validity :without
end
private
......@@ -37,7 +37,7 @@ def regexp_using_multiline_anchors?(regexp)
source.start_with?("^") || (source.end_with?("$") && !source.end_with?("\\$"))
end
def check_options_validity(options, name)
def check_options_validity(name)
option = options[name]
if option && !option.is_a?(Regexp) && !option.respond_to?(:call)
raise ArgumentError, "A regular expression or a proc or lambda must be supplied as :#{name}"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册