Class: HatiJsonapiError::Source

Inherits:
Object
  • Object
show all
Defined in:
lib/hati_jsonapi_error/api_error/source.rb

Overview

This class is used to build the source object for the error response.

Constant Summary collapse

STR =
''

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pointer: STR, parameter: STR, header: STR) ⇒ Source

Returns a new instance of Source.



10
11
12
13
14
# File 'lib/hati_jsonapi_error/api_error/source.rb', line 10

def initialize(pointer: STR, parameter: STR, header: STR)
  @pointer = pointer
  @parameter = parameter
  @header = header
end

Instance Attribute Details

#headerObject

Returns the value of attribute header.



8
9
10
# File 'lib/hati_jsonapi_error/api_error/source.rb', line 8

def header
  @header
end

#parameterObject

Returns the value of attribute parameter.



8
9
10
# File 'lib/hati_jsonapi_error/api_error/source.rb', line 8

def parameter
  @parameter
end

#pointerObject

Returns the value of attribute pointer.



8
9
10
# File 'lib/hati_jsonapi_error/api_error/source.rb', line 8

def pointer
  @pointer
end

Instance Method Details

#to_hObject



16
17
18
19
20
21
22
# File 'lib/hati_jsonapi_error/api_error/source.rb', line 16

def to_h
  {
    pointer: pointer,
    parameter: parameter,
    header: header
  }
end