mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
27 lines
543 B
Ruby
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
|