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.


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

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

Instance Attribute Details

#barcodeObject (readonly)

Returns the value of attribute barcode


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

def barcode
  @barcode
end

#locationObject (readonly)

Returns the value of attribute location


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

def location
  @location
end

Class Method Details

.find_by_barcode(barcode) ⇒ Object


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

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

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