Class: Descriptor

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

Overview

rubocop:todo Style/Documentation

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 Squishify

extended

Instance Method Details

#is_required?Boolean

Returns:

  • (Boolean)

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

def is_required?
  required
end

#matches?(search) ⇒ Boolean

Returns:

  • (Boolean)

10
11
12
13
# File 'app/models/descriptor.rb', line 10

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