mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
19 lines
513 B
Ruby
19 lines
513 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Api
|
|
module V1
|
|
class AddressSerializer < BaseSerializer
|
|
attributes :phone, :latitude, :longitude
|
|
|
|
attribute :first_name, &:firstname
|
|
attribute :last_name, &:lastname
|
|
attribute :street_address_1, &:address1
|
|
attribute :street_address_2, &:address2
|
|
attribute :postal_code, &:zipcode
|
|
attribute :locality, &:city
|
|
attribute :region, &:state_name
|
|
attribute :country, ->(object, _) { object.country.name }
|
|
end
|
|
end
|
|
end
|