dawarich/app/serializers/api/place_serializer.rb

28 lines
543 B
Ruby
Raw Normal View History

2025-03-03 14:11:21 -05:00
# frozen_string_literal: true
class Api::PlaceSerializer
def initialize(place)
@place = place
end
def call
{
2025-05-12 17:36:46 -04:00
id: place.id,
name: place.name,
longitude: place.lon,
latitude: place.lat,
city: place.city,
country: place.country,
source: place.source,
geodata: place.geodata,
created_at: place.created_at,
2025-05-15 12:23:24 -04:00
updated_at: place.updated_at,
reverse_geocoded_at: place.reverse_geocoded_at
2025-03-03 14:11:21 -05:00
}
end
private
attr_reader :place
end