Class: RuboCop::Kata::Variable::Ledger

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop/kata/variable/ledger.rb

Overview

SPDX-FileCopyrightText: Copyright (c) 2019-2026 Yegor Bugayenko SPDX-License-Identifier: MIT Derived from rubocop-elegant (https://github.com/yegor256/rubocop-elegant), see LICENSE.txt

Constant Summary collapse

STATEMENT_PARENTS =
%i[begin kwbegin def defs block numblock].freeze

Instance Method Summary collapse

Constructor Details

#initialize(body) ⇒ Ledger

Returns a new instance of Ledger.



10
11
12
# File 'lib/rubocop/kata/variable/ledger.rb', line 10

def initialize(body)
  @body = body
end

Instance Method Details

#pairsObject



14
15
16
# File 'lib/rubocop/kata/variable/ledger.rb', line 14

def pairs
  singles.reject { |assign, read| RuboCop::Kata::Variable::Boundary.new(assign, read).crossed? }.to_h
end