Class: RuboCop::Kata::Variable::Inlining
- Inherits:
-
Object
- Object
- RuboCop::Kata::Variable::Inlining
- Defined in:
- lib/rubocop/kata/variable/inlining.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
- PRIMARY =
%i[ int float str sym dstr dsym xstr true false nil array hash regexp lvar ivar cvar gvar const self nth_ref back_ref ].freeze
Instance Method Summary collapse
-
#initialize(rhs, read) ⇒ Inlining
constructor
A new instance of Inlining.
- #range ⇒ Object
- #text ⇒ Object
Constructor Details
#initialize(rhs, read) ⇒ Inlining
Returns a new instance of Inlining.
13 14 15 16 |
# File 'lib/rubocop/kata/variable/inlining.rb', line 13 def initialize(rhs, read) @rhs = rhs @read = read end |
Instance Method Details
#range ⇒ Object
18 |
# File 'lib/rubocop/kata/variable/inlining.rb', line 18 def range = pair.nil? ? @read.source_range : pair.source_range |
#text ⇒ Object
20 |
# File 'lib/rubocop/kata/variable/inlining.rb', line 20 def text = pair.nil? ? value : "#{pair.children.first.source}: #{value}" |