Exception: JSONAPI::Exceptions::InvalidFieldValue
- Defined in:
- lib/jsonapi/exceptions.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
Returns the value of attribute field.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(field, value) ⇒ InvalidFieldValue
constructor
A new instance of InvalidFieldValue.
Constructor Details
#initialize(field, value) ⇒ InvalidFieldValue
Returns a new instance of InvalidFieldValue.
104 105 106 107 |
# File 'lib/jsonapi/exceptions.rb', line 104 def initialize(field, value) @field = field @value = value end |
Instance Attribute Details
#field ⇒ Object
Returns the value of attribute field.
103 104 105 |
# File 'lib/jsonapi/exceptions.rb', line 103 def field @field end |
#value ⇒ Object
Returns the value of attribute value.
103 104 105 |
# File 'lib/jsonapi/exceptions.rb', line 103 def value @value end |
Instance Method Details
#errors ⇒ Object
109 110 111 112 113 114 |
# File 'lib/jsonapi/exceptions.rb', line 109 def errors [JSONAPI::Error.new(code: JSONAPI::INVALID_FIELD_VALUE, status: :bad_request, title: 'Invalid field value', detail: "#{value} is not a valid value for #{field}.")] end |