* Ensure transcendence is possible on that character * Ensure transcendence_step is in bounds * Ensure Over Mastery Attack is a valid value * Ensure Over Mastery HP is a valid value * Ensure Over Mastery Attack is 2x Over Mastery HP * Ensure Awakening level is in bounds
23 lines
663 B
Ruby
23 lines
663 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Api
|
|
module V1
|
|
class ErrorBlueprint < Blueprinter::Base
|
|
field :error, if: ->(_field_name, _error, options) { options.key?(:error) } do |_, options|
|
|
options[:error]
|
|
end
|
|
|
|
field :errors, if: ->(_field_name, _error, options) { options.key?(:errors) } do |_, options|
|
|
options[:errors]
|
|
end
|
|
|
|
field :errors, if: ->(_field_name, _error, options) { options.key?(:exception) } do |_, options|
|
|
options[:exception]
|
|
end
|
|
|
|
field :errors, if: ->(_field_name, object, options) { options.key?(:errors) } do |_, options|
|
|
options[:errors]
|
|
end
|
|
end
|
|
end
|
|
end
|