Class: LabWhereClient::Location
- Defined in:
- lib/lab_where_client.rb
Instance Attribute Summary collapse
-
#barcode ⇒ Object
readonly
Returns the value of attribute barcode.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parentage ⇒ Object
readonly
Returns the value of attribute parentage.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params) ⇒ Location
constructor
A new instance of Location.
- #location_info ⇒ Object
Methods inherited from Endpoint
Constructor Details
#initialize(params) ⇒ Location
Returns a new instance of Location.
166 167 168 169 170 |
# File 'lib/lab_where_client.rb', line 166 def initialize(params) @name = params['name'] @parentage = params['parentage'] @barcode = params['barcode'] end |
Instance Attribute Details
#barcode ⇒ Object (readonly)
Returns the value of attribute barcode.
157 158 159 |
# File 'lib/lab_where_client.rb', line 157 def @barcode end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
157 158 159 |
# File 'lib/lab_where_client.rb', line 157 def name @name end |
#parentage ⇒ Object (readonly)
Returns the value of attribute parentage.
157 158 159 |
# File 'lib/lab_where_client.rb', line 157 def parentage @parentage end |
Class Method Details
.children(barcode) ⇒ Object
178 179 180 181 182 183 184 185 186 187 |
# File 'lib/lab_where_client.rb', line 178 def self.children() return [] if .blank? endpoint_name "locations/#{}" attrs = LabWhere.new.get(self, 'children') return [] if attrs.nil? attrs.map { |locn_params| new(locn_params) } end |
.find_by_barcode(barcode) ⇒ Object
159 160 161 162 163 164 |
# File 'lib/lab_where_client.rb', line 159 def self.() return nil if .blank? attrs = LabWhere.new.get(self, ) new(attrs) unless attrs.nil? end |
.labwares(barcode) ⇒ Object
189 190 191 192 193 194 195 196 197 198 |
# File 'lib/lab_where_client.rb', line 189 def self.labwares() return [] if .blank? endpoint_name "locations/#{}" attrs = LabWhere.new.get(self, 'labwares') return [] if attrs.nil? attrs.map { |labware_params| Labware.new(labware_params) } end |
Instance Method Details
#location_info ⇒ Object
172 173 174 175 176 |
# File 'lib/lab_where_client.rb', line 172 def location_info return '' if parentage.blank? && name.blank? [parentage, name].join(' - ') end |