Class: MigrationPlans::ExportConfigService

Inherits:
Object
  • Object
show all
Defined in:
app/services/migration_plans/export_config_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(migration_plan) ⇒ ExportConfigService

Returns a new instance of ExportConfigService.



7
8
9
# File 'app/services/migration_plans/export_config_service.rb', line 7

def initialize(migration_plan)
  @migration_plan = migration_plan
end

Instance Attribute Details

#migration_planObject (readonly)

Returns the value of attribute migration_plan.



5
6
7
# File 'app/services/migration_plans/export_config_service.rb', line 5

def migration_plan
  @migration_plan
end

Instance Method Details

#callObject



11
12
13
14
15
16
17
18
19
20
21
# File 'app/services/migration_plans/export_config_service.rb', line 11

def call
  {
    version: '1.0',
    exported_at: Time.current.iso8601,
    plan: {
      name: migration_plan.name,
      description: migration_plan.description,
      steps: export_steps
    }
  }.to_json
end