Class: LabWhereClient::Labware

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Endpoint

endpoint_name

Constructor Details

#initialize(params) ⇒ Labware


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

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

Instance Attribute Details

#barcodeObject (readonly)

Returns the value of attribute barcode


90
91
92
# File 'lib/lab_where_client.rb', line 90

def barcode
  @barcode
end

#locationObject (readonly)

Returns the value of attribute location


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

def location
  @location
end

Class Method Details

.find_by_barcode(barcode) ⇒ Object


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

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

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