Class: PipelineService::PipelineClient

Inherits:
Object
  • Object
show all
Defined in:
app/services/pipeline_service/pipeline_client.rb

Overview

PipelineClient builds a pipeline message using the object posts it to the endpoint and logs the message that was sent.

Accepts an ActiveRecord object or a hash. If using a hash, you must provide a noun as an optional parameter

PipelineCient.new(object: Enrollment.last) PipelineCient.new(object: { data: { foo: ‘bar’ } }, noun: ‘enrollment’ )

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ PipelineClient

Returns a new instance of PipelineClient.



11
12
13
14
15
# File 'app/services/pipeline_service/pipeline_client.rb', line 11

def initialize(args)
  @args = args
  @object = args[:object]
  configure_dependencies
end

Instance Method Details

#callObject



17
18
19
20
21
# File 'app/services/pipeline_service/pipeline_client.rb', line 17

def call
  fetch_enrollment_from_hash
  post
  self
end