Class: UffizziCore::ComposeFile::ContinuousPreviewOptionsService

Inherits:
Object
  • Object
show all
Defined in:
app/services/uffizzi_core/compose_file/continuous_preview_options_service.rb

Class Method Summary collapse

Class Method Details

.parse(continuous_preview_data) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/services/uffizzi_core/compose_file/continuous_preview_options_service.rb', line 5

def parse(continuous_preview_data)
  return {} if continuous_preview_data.nil?

  {
    deploy_preview_when_pull_request_is_opened: trigger_value(continuous_preview_data, 'deploy_preview_when_pull_request_is_opened'),
    delete_preview_when_pull_request_is_closed: trigger_value(continuous_preview_data, 'delete_preview_when_pull_request_is_closed'),
    deploy_preview_when_image_tag_is_created: trigger_value(continuous_preview_data, 'deploy_preview_when_image_tag_is_created'),
    delete_preview_when_image_tag_is_updated: trigger_value(continuous_preview_data, 'delete_preview_when_image_tag_is_updated'),
    delete_preview_after: delete_preview_after_value(continuous_preview_data['delete_preview_after']),
    share_to_github: trigger_value(continuous_preview_data, 'share_to_github'),
  }
end