dawarich/app/serializers/api/place_serializer.rb

28 lines
543 B
Ruby
Raw Normal View History

2025-11-19 14:56:46 -05:00
# 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