Method: Gruf::Errors::Field#initialize

Defined in:
lib/gruf/errors/field.rb

#initialize(field_name, error_code, message = '') ⇒ Field

Returns a new instance of Field.

Parameters:

  • field_name (Symbol)

    The name of the field as a Symbol

  • error_code (Symbol)

    The application error code for the field, e.g. :job_not_found

  • message (String) (defaults to: '')

    (Optional) The error message for the field, e.g. “Job with ID 123 not found”



34
35
36
37
38
# File 'lib/gruf/errors/field.rb', line 34

def initialize(field_name, error_code, message = '')
  @field_name = field_name
  @error_code = error_code
  @message = message
end