Skip to content

Commit

Permalink
Reduce complexity in conversions class
Browse files Browse the repository at this point in the history
  • Loading branch information
swanny85 committed Dec 21, 2023
1 parent 2337bb4 commit 888e707
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions lib/fulfil/conversions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@ class Conversions
class << self
def update_date_and_datetime_fields(domain)
domain.each do |params|
params.map! do |param|
case param
when Date
date_as_object(param)
when DateTime
datetime_as_object(param)
else
param
end
update_date_and_datetime_fields_in_params(params)
end
end

private

def update_date_and_datetime_fields_in_params(params)
params.map! do |param|
case param
when Date
date_as_object(param)
when DateTime
datetime_as_object(param)
else
param
end
end
end
Expand Down

0 comments on commit 888e707

Please sign in to comment.