Class: TagLayoutTemplate

Inherits:
ApplicationRecord show all
Includes:
Lot::Template, Uuid::Uuidable
Defined in:
app/models/tag_layout_template.rb

Overview

This is a layout template for tags. Think of it as a partially created TagLayout, defining only the tag group that will be used and the actual TagLayout implementation that will do the work.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Lot::Template

included

Methods included from Uuid::Uuidable

included, #unsaved_uuid!, #uuid

Methods inherited from ApplicationRecord

convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!

Methods included from Warren::BroadcastMessages

#broadcast, included, #queue_associated_for_broadcast, #queue_for_broadcast, #warren

Instance Attribute Details

#enforce_uniqueness=(value) ⇒ Object

Sets the attribute enforce_uniqueness

Parameters:

  • value

    the value to set the attribute enforce_uniqueness to.


7
8
9
# File 'app/models/tag_layout_template.rb', line 7

def enforce_uniqueness=(value)
  @enforce_uniqueness = value
end

Instance Method Details

#create!(attributes = {}, &block) ⇒ Object

Create a TagLayout instance that does the actual work of laying out the tags.


28
29
30
31
32
# File 'app/models/tag_layout_template.rb', line 28

def create!(attributes = {}, &block)
  TagLayout.create!(attributes.merge(tag_layout_attributes), &block).tap do |tag_layout|
    record_template_use(tag_layout.plate)
  end
end

#stamp_to(_) ⇒ Object


23
24
25
# File 'app/models/tag_layout_template.rb', line 23

def stamp_to(_)
  # Do Nothing
end