Class: LevelTravel::Search::Params

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/level_travel/search/params.rb

Instance Method Summary collapse

Instance Method Details

#to_hObject



18
19
20
21
22
23
24
# File 'lib/level_travel/search/params.rb', line 18

def to_h
  result = super.merge(start_date: start_date.strftime('%d.%m.%Y'))
  result = result.merge(hotel_ids: hotel_ids.join(',')) if result[:hotel_ids]
  result = result.merge(kids_ages: kids_ages.join(',')) if result[:kids_ages]

  result
end