rubocop: In-line disables of Naming/MemoizedInstanceVariableName

This commit is contained in:
Issy Long 2023-02-18 23:01:22 +00:00
parent d84d157aaa
commit 6797f30bbf
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4
2 changed files with 2 additions and 5 deletions

View File

@ -323,11 +323,6 @@ Lint/DuplicateBranch:
- "/**/{Formula,Casks}/*.rb" - "/**/{Formula,Casks}/*.rb"
- "**/{Formula,Casks}/*.rb" - "**/{Formula,Casks}/*.rb"
# needed for lazy_object magic
Naming/MemoizedInstanceVariableName:
Exclude:
- "Homebrew/lazy_object.rb"
# useful for metaprogramming in RSpec # useful for metaprogramming in RSpec
Lint/ConstantDefinitionInBlock: Lint/ConstantDefinitionInBlock:
Exclude: Exclude:

View File

@ -10,9 +10,11 @@ class LazyObject < Delegator
end end
def __getobj__ def __getobj__
# rubocop:disable Naming/MemoizedInstanceVariableName
return @__delegate__ if defined?(@__delegate__) return @__delegate__ if defined?(@__delegate__)
@__delegate__ = @__callable__.call @__delegate__ = @__callable__.call
# rubocop:enable Naming/MemoizedInstanceVariableName
end end
def __setobj__(callable) def __setobj__(callable)