Class: CrossSpec::TaskMessage

Inherits:
Message
  • Object
show all
Defined in:
lib/cross_spec/task_message.rb

Instance Attribute Summary collapse

Attributes inherited from Message

#biomarkers, #data

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Message

#origin_biomarker

Constructor Details

#initialize(task:, data: nil, biomarkers: nil) ⇒ TaskMessage

Returns a new instance of TaskMessage.



3
4
5
6
# File 'lib/cross_spec/task_message.rb', line 3

def initialize(task:, data: nil, biomarkers: nil)
  super(data: data, biomarkers: biomarkers)
  @task = task
end

Instance Attribute Details

#taskObject (readonly)

Returns the value of attribute task.



8
9
10
# File 'lib/cross_spec/task_message.rb', line 8

def task
  @task
end

Class Method Details

.from_json(json) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/cross_spec/task_message.rb', line 10

def self.from_json(json)
  new(
    task: json["task"],
    data: json["data"],
    biomarkers: json["biomarkers"]
  )
end