Method: Unit::Event::ListEventParams#to_hash

Defined in:
lib/unit/models/event/list_event_params.rb

#to_hashObject



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/unit/models/event/list_event_params.rb', line 23

def to_hash
  params = {
    "page[limit]": limit,
    "page[offset]": offset,
    "filter[since]": since,
    "filter[until]": _until
  }
  type&.each_with_index&.map do |val, index|
    params.merge!({ "filter[type][#{index}]": val })
  end
  params.compact
end