From 0f45a4b235a3e68ca3da6e3066b3acde33317f8c Mon Sep 17 00:00:00 2001 From: Jacob Sheehy Date: Tue, 29 Oct 2024 09:40:04 -0400 Subject: [PATCH] [chore] Up formatting and use consistent syntax --- lib/blueprinter/rendering.rb | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/blueprinter/rendering.rb b/lib/blueprinter/rendering.rb index 93d769db..e39ef294 100644 --- a/lib/blueprinter/rendering.rb +++ b/lib/blueprinter/rendering.rb @@ -103,14 +103,18 @@ def hashify(object, view_name:, local_options:) def prepare_data(object, view_name, local_options) if array_like?(object) object.map do |obj| - object_to_hash(obj, - view_name: view_name, - local_options: local_options) + object_to_hash( + obj, + view_name: view_name, + local_options: local_options + ) end else - object_to_hash(object, - view_name: view_name, - local_options: local_options) + object_to_hash( + object, + view_name: view_name, + local_options: local_options + ) end end @@ -141,7 +145,7 @@ def apply_root_key(object:, root:) end def add_metadata(object:, metadata:, root:) - return object if metadata.nil? + return object unless metadata return object.merge(meta: metadata) if root raise(Errors::MetaRequiresRoot)