Class: JSONAPI::Warning

Inherits:
Object
  • Object
show all
Defined in:
lib/jsonapi/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Warning

Returns a new instance of Warning.



24
25
26
27
28
29
30
31
32
# File 'lib/jsonapi/error.rb', line 24

def initialize(options = {})
  @title          = options[:title]
  @detail         = options[:detail]
  @code           = if JSONAPI.configuration.use_text_errors
                      TEXT_ERRORS[options[:code]]
                    else
                      options[:code]
                    end
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



23
24
25
# File 'lib/jsonapi/error.rb', line 23

def code
  @code
end

#detailObject

Returns the value of attribute detail.



23
24
25
# File 'lib/jsonapi/error.rb', line 23

def detail
  @detail
end

#titleObject

Returns the value of attribute title.



23
24
25
# File 'lib/jsonapi/error.rb', line 23

def title
  @title
end