ruby abs function programming

# Step 1: Define a method named 'absolute_value' that takes one parameter 'number'.
def absolute_value(number)
  # Step 2: Use a conditional statement to check if the input 'number' is less than 0.
  if number < 0
    # Step 3: If 'number' is less than 0, return the negation of 'number' to get its absolute value.
    return -number
  else
    # Step 4: If 'number' is greater than or equal to 0, simply return 'number' as it is the absolute value.
    return number
  end
end

# Step 5: Call the 'absolute_value' method with an example input (e.g., -5) and store the result in a variable.
result = absolute_value(-5)

# Step 6: Print the result to the console.
puts result