Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 427 Bytes

split-variable.md

File metadata and controls

31 lines (23 loc) · 427 Bytes

Split Variable

Instead of reassigning a variable, give a different name to each value.

Example

Before

python_version = 2
if is_red_hat_8?
  python_version = 3
end

After

default_python_version = 2
python_version =
  if is_red_hat_8?
    3
  else
    default_python_version
  end

References