dawarich/app/serializers/api/place_serializer.rb
2025-11-19 20:56:46 +01:00

27 lines
543 B
Ruby

# frozen_string_literal: true
class Api::PlaceSerializer
def initialize(place)
@place = place
end
def call
{
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,
updated_at: place.updated_at,
reverse_geocoded_at: place.reverse_geocoded_at
}
end
private
attr_reader :place
end