Class: PipelineService::Commands::Publish

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

Overview

Serialize a canvas object into their API format and send to the pipeline

Usage: Send.new(message: User.last).call

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Publish

Returns a new instance of Publish.



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

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

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



9
10
11
# File 'app/services/pipeline_service/commands/publish.rb', line 9

def message
  @message
end

#serializerObject (readonly)

Returns the value of attribute serializer.



9
10
11
# File 'app/services/pipeline_service/commands/publish.rb', line 9

def serializer
  @serializer
end

Instance Method Details

#callObject



18
19
20
21
22
23
# File 'app/services/pipeline_service/commands/publish.rb', line 18

def call
  return if SettingsService.get_settings(object: :school, id: 1)['disable_pipeline']
  post_to_pipeline
  publish_events unless changes.nil?
  self
end