Class: Eco::API::UseCases::GraphQL::Samples::Pages::Template::Deploy::SyncReadiness::EntryReadiness

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

Overview

Per-entry readiness verdict.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#entry_idObject

Returns the value of attribute entry_id

Returns:

  • (Object)

    the current value of entry_id



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

def entry_id
  @entry_id
end

#missing_requiredObject

Returns the value of attribute missing_required

Returns:

  • (Object)

    the current value of missing_required



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

def missing_required
  @missing_required
end

#readyObject

Returns the value of attribute ready

Returns:

  • (Object)

    the current value of ready



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

def ready
  @ready
end

#type_mismatchesObject

Returns the value of attribute type_mismatches

Returns:

  • (Object)

    the current value of type_mismatches



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

def type_mismatches
  @type_mismatches
end

Instance Method Details

#ready?Boolean

Returns:

  • (Boolean)


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

def ready?
  ready ? true : false
end

#reasonsObject



30
31
32
33
34
35
36
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/sync_readiness.rb', line 30

def reasons
  out = Array(missing_required).map { |m| "missing required '#{m}'" }
  Array(type_mismatches).each do |m|
    out << "type mismatch '#{m[:label]}' (want #{m[:expected]}, got #{m[:actual]})"
  end
  out
end

#to_hObject



38
39
40
41
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/sync_readiness.rb', line 38

def to_h
  { entry_id: entry_id, ready: ready?, missing_required: Array(missing_required),
    type_mismatches: Array(type_mismatches) }
end