2022-09-22 17:07:08 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class LabelPrinterSerializer < ActiveModel::Serializer
|
|
|
|
include Rails.application.routes.url_helpers
|
2022-09-28 19:25:55 +08:00
|
|
|
include ApplicationHelper
|
2022-09-22 17:07:08 +08:00
|
|
|
|
2022-10-12 22:56:58 +08:00
|
|
|
attributes :name, :display_name, :description, :type_of, :language_type, :status
|
2022-09-22 17:07:08 +08:00
|
|
|
|
|
|
|
def urls
|
|
|
|
{
|
|
|
|
}
|
|
|
|
end
|
2022-09-28 19:25:55 +08:00
|
|
|
|
|
|
|
def display_name
|
2023-03-14 01:00:30 +08:00
|
|
|
object.description.present? ? escape_input("#{object.name} • #{object.description}") : escape_input(object.name)
|
2022-09-28 19:25:55 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
def status
|
|
|
|
object.status.dasherize
|
|
|
|
end
|
2022-09-22 17:07:08 +08:00
|
|
|
end
|