Class: LabWhereClient::Scan

Inherits:
Endpoint show all
Includes:
EndpointCreateActions
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 included from EndpointCreateActions

included

Methods inherited from Endpoint

endpoint_name

Constructor Details

#initialize(params) ⇒ Scan

Returns a new instance of Scan.


135
136
137
138
# File 'lib/lab_where_client.rb', line 135

def initialize(params)
  @message = params['message']
  @errors = params['errors']
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors


131
132
133
# File 'lib/lab_where_client.rb', line 131

def errors
  @errors
end

#messageObject (readonly)

Returns the value of attribute message


131
132
133
# File 'lib/lab_where_client.rb', line 131

def message
  @message
end

Class Method Details

.creation_params(params) ⇒ Object


144
145
146
147
148
# File 'lib/lab_where_client.rb', line 144

def self.creation_params(params)
  obj = params.dup
  obj[:labware_barcodes] = obj[:labware_barcodes].join("\n")
  { scan: obj }
end

Instance Method Details

#errorObject


154
155
156
# File 'lib/lab_where_client.rb', line 154

def error
  @errors.join(';')
end

#response_messageObject


140
141
142
# File 'lib/lab_where_client.rb', line 140

def response_message
  @message
end

#valid?Boolean

Returns:

  • (Boolean)

150
151
152
# File 'lib/lab_where_client.rb', line 150

def valid?
  @errors.nil?
end