Class: LabWhereClient::Scan

Inherits:
Endpoint show all
Includes:
EndpointCreateActions
Defined in:
lib/lab_where_client.rb

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


113
114
115
116
# File 'lib/lab_where_client.rb', line 113

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

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors


109
110
111
# File 'lib/lab_where_client.rb', line 109

def errors
  @errors
end

#messageObject (readonly)

Returns the value of attribute message


109
110
111
# File 'lib/lab_where_client.rb', line 109

def message
  @message
end

Class Method Details

.creation_params(params) ⇒ Object


122
123
124
125
126
# File 'lib/lab_where_client.rb', line 122

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

Instance Method Details

#errorObject


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

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

#response_messageObject


118
119
120
# File 'lib/lab_where_client.rb', line 118

def response_message
  @message
end

#valid?Boolean

Returns:

  • (Boolean)

128
129
130
# File 'lib/lab_where_client.rb', line 128

def valid?
  @errors.nil?
end