Class: HatiJsonapiError::Links

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

Overview

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

Constant Summary collapse

STR =
''

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(about: STR, type: STR) ⇒ Links

Returns a new instance of Links.



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

def initialize(about: STR, type: STR)
  @about = about
  @type = type
end

Instance Attribute Details

#aboutObject

Returns the value of attribute about.



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

def about
  @about
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#to_hObject



15
16
17
18
19
20
# File 'lib/hati_jsonapi_error/api_error/links.rb', line 15

def to_h
  {
    about: about,
    type: type
  }
end