sanger/sequencescape

View on GitHub
app/api/io/barcode_printer.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true
# Controls API V1 IO for {::BarcodePrinter}
class Io::BarcodePrinter < Core::Io::Base
  set_model_for_input(::BarcodePrinter)
  set_json_root(:barcode_printer)
  set_eager_loading(&:include_barcode_printer_type)

  define_attribute_and_json_mapping(
    '
                                    name  => name
                                  active  => active
                            print_service => print_service
                             service_url  => service.url
               barcode_printer_type.name  => type.name
    barcode_printer_type.printer_type_id  => type.layout
  '
  )
end