Skip to content

Commit

Permalink
[chore] Up formatting and use consistent syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
lessthanjacob committed Oct 29, 2024
1 parent 0df427e commit 0f45a4b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions lib/blueprinter/rendering.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0f45a4b

Please sign in to comment.