Class: Descriptor

Inherits:
ApplicationRecord show all
Defined in:
app/models/descriptor.rb

Instance Method Summary collapse

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 Method Details

#is_required?Boolean

Returns:

  • (Boolean)

5
6
7
# File 'app/models/descriptor.rb', line 5

def is_required?
  required
end

#matches?(search) ⇒ Boolean

Returns:

  • (Boolean)

9
10
11
12
13
14
15
16
# File 'app/models/descriptor.rb', line 9

def matches?(search)
  search.descriptors.each do |descriptor|
    if descriptor.name == name && descriptor.value == value
      return true
    end
  end
  false
end