From 32a565b6d9db37bbb462194982870f4c24ac2c64 Mon Sep 17 00:00:00 2001 From: Kyle Welsby Date: Fri, 28 Jun 2024 19:48:23 +0100 Subject: [PATCH] refactor: Simplify name formatting method --- lib/name_formatter.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/name_formatter.rb b/lib/name_formatter.rb index 739527c..018cc74 100644 --- a/lib/name_formatter.rb +++ b/lib/name_formatter.rb @@ -58,8 +58,8 @@ def parse(name, last_name_only: false) } end - def parse_formatted(name, **options) - parsed = parse(name, **options) + def parse_formatted(name, **) + parsed = parse(name, **) { prefix: format_prefix(parsed[:prefix]), first_name: format_first_name(parsed[:first_name]), @@ -68,8 +68,8 @@ def parse_formatted(name, **options) } end - def format(name, **options) - parse_formatted(name, **options).values.compact.join(" ") + def format(name, **) + parse_formatted(name, **).values.compact.join(" ") end private