diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f6e785d0..89afa6b7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ * [#70](https://github.com/rubocop-hq/rubocop-ast/pull/70): Fix arguments processing for `BreakNode` ([@marcandre][]) * [#70](https://github.com/rubocop-hq/rubocop-ast/pull/70): **(Potentially breaking)** `BreakNode` and `ReturnNode` no longer include `MethodDispatchNode`. These methods were severely broken ([@marcandre][]) +### Changes + +* [#86](https://github.com/rubocop-hq/rubocop-ast/pull/86): `PairNode#delimiter` and `inverse_delimiter` now accept their argument as a named argument. ([@marcandre][]) + ## 0.2.0 (2020-07-19) ### New features diff --git a/lib/rubocop/ast/node/pair_node.rb b/lib/rubocop/ast/node/pair_node.rb index da2e34bea..5e7cc5271 100644 --- a/lib/rubocop/ast/node/pair_node.rb +++ b/lib/rubocop/ast/node/pair_node.rb @@ -32,7 +32,7 @@ def colon? # # @param [Boolean] with_spacing whether to include spacing # @return [String] the delimiter of the `pair` - def delimiter(with_spacing = false) + def delimiter(*deprecated, with_spacing: deprecated.first) if with_spacing hash_rocket? ? SPACED_HASH_ROCKET : SPACED_COLON else @@ -44,7 +44,7 @@ def delimiter(with_spacing = false) # # @param [Boolean] with_spacing whether to include spacing # @return [String] the inverse delimiter of the `pair` - def inverse_delimiter(with_spacing = false) + def inverse_delimiter(*deprecated, with_spacing: deprecated.first) if with_spacing hash_rocket? ? SPACED_COLON : SPACED_HASH_ROCKET else