dawarich/app/serializers/api/slim_point_serializer.rb

21 lines
304 B
Ruby
Raw Permalink Normal View History

# frozen_string_literal: true
class Api::SlimPointSerializer
def initialize(point)
@point = point
end
def call
{
id: point.id,
2025-02-21 18:32:30 -05:00
latitude: point.lat.to_s,
longitude: point.lon.to_s,
timestamp: point.timestamp
}
end
private
attr_reader :point
end