Class: Ecoportal::API::GraphQL::Payload::LocationStructure::CommandExecutionResult

Inherits:
Logic::BaseModel show all
Includes:
Error::LocationsError::FetchNested
Defined in:
lib/ecoportal/api/graphql/payload/location_structure/command_execution_result.rb

Constant Summary

Constants included from Common::GraphQL::Model::Diffable

Common::GraphQL::Model::Diffable::DIFF_CLASS

Instance Method Summary collapse

Methods included from Error::LocationsError::FetchNested

#conflictingIds, #conflictingIds?, #locations_error?, #locations_error_doc, #validationErrors, #validationErrors?

Methods included from Common::GraphQL::Model::AsInput

#as_input

Methods included from Common::GraphQL::Model::Diffable

#as_update, #dirty?

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/ecoportal/api/graphql/payload/location_structure/command_execution_result.rb', line 16

def error?
  !ok? || locations_error?
end

#error_docObject



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/ecoportal/api/graphql/payload/location_structure/command_execution_result.rb', line 20

def error_doc
  if locations_error?
    {
      locationsError: locations_error_doc
    }
  elsif !ok?
    {
      ok: false
    }
  end
end

#success?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/ecoportal/api/graphql/payload/location_structure/command_execution_result.rb', line 32

def success?
  !error?
end