Class: CrossSpec::ServiceMessage

Inherits:
Message
  • Object
show all
Defined in:
lib/cross_spec/service_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(service:, data: nil, biomarkers: nil) ⇒ ServiceMessage

Returns a new instance of ServiceMessage.



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

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

Instance Attribute Details

#serviceObject (readonly)

Returns the value of attribute service.



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

def service
  @service
end

Class Method Details

.from_json(json) ⇒ Object



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

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