Class: LabWhereClient::Labware

Inherits:
Endpoint
  • Object
show all
Defined in:
lib/lab_where_client.rb

Overview

rubocop:todo Style/Documentation

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Endpoint

endpoint_name

Constructor Details

#initialize(params) ⇒ Labware

Returns a new instance of Labware.


102
103
104
105
# File 'lib/lab_where_client.rb', line 102

def initialize(params)
  @barcode = params['barcode']
  @location = Location.new(params['location'])
end

Instance Attribute Details

#barcodeObject (readonly)

Returns the value of attribute barcode.


93
94
95
# File 'lib/lab_where_client.rb', line 93

def barcode
  @barcode
end

#locationObject (readonly)

Returns the value of attribute location.


93
94
95
# File 'lib/lab_where_client.rb', line 93

def location
  @location
end

Class Method Details

.find_by_barcode(barcode) ⇒ Object


95
96
97
98
99
100
# File 'lib/lab_where_client.rb', line 95

def self.find_by_barcode(barcode)
  return nil if barcode.blank?

  attrs = LabWhere.new.get(self, barcode)
  new(attrs) unless attrs.nil?
end