Class: Eco::API::UseCases::GraphQL::Samples::Pages::Template::Deploy::Applier::Outcome

Inherits:
Struct
  • Object
show all
Defined in:
lib/eco/api/usecases/graphql/samples/pages/template/deploy/applier.rb

Overview

Result of an apply attempt. committed? is only true when the batch was actually sent live.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#commandsObject

Returns the value of attribute commands

Returns:

  • (Object)

    the current value of commands



24
25
26
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/applier.rb', line 24

def commands
  @commands
end

#committedObject

Returns the value of attribute committed

Returns:

  • (Object)

    the current value of committed



24
25
26
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/applier.rb', line 24

def committed
  @committed
end

#responseObject

Returns the value of attribute response

Returns:

  • (Object)

    the current value of response



24
25
26
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/applier.rb', line 24

def response
  @response
end

#skipped_reasonObject

Returns the value of attribute skipped_reason

Returns:

  • (Object)

    the current value of skipped_reason



24
25
26
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/applier.rb', line 24

def skipped_reason
  @skipped_reason
end

#unsupportedObject

Returns the value of attribute unsupported

Returns:

  • (Object)

    the current value of unsupported



24
25
26
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/applier.rb', line 24

def unsupported
  @unsupported
end

Instance Method Details

#applied?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/applier.rb', line 30

def applied?
  committed? || dry_run?
end

#committed?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/applier.rb', line 26

def committed?
  committed ? true : false
end

#dry_run?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/applier.rb', line 34

def dry_run?
  !committed? && skipped_reason.nil?
end

#to_hObject



38
39
40
41
42
43
44
45
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/applier.rb', line 38

def to_h
  {
    committed:      committed?,
    commands:       commands,
    unsupported:    Array(unsupported).map { |c| c.respond_to?(:to_h) ? c.to_h : c },
    skipped_reason: skipped_reason
  }.compact
end