class Api::V1::LocationSerializer < ActiveModel::Serializer
  attributes :id, :name, :address

  attribute :picture do
    {
      thumb: object.image_url(:thumb),
      small: object.image_url(:small),
      medium: object.image_url(:medium)
    }
  end

  def address
    object.address.try(:address1)
  end
end
