active_model_serializers/lib/active_model_serializers/json_pointer.rb
Benjamin Fleischer 0ba944dabf RFC: Json Api Errors (WIP)
- ActiveModelSerializers::JsonPointer
- ActiveModel::Serializer::Adapter::JsonApi::Error
- ActiveModel::Serializer::Adapter::JsonApi::Error.attributes
- Fix rubocop config
2016-03-06 12:03:14 -06:00

15 lines
289 B
Ruby

module ActiveModelSerializers
module JsonPointer
module_function
POINTERS = {
attribute: '/data/attributes/%s'.freeze,
primary_data: '/data'.freeze
}.freeze
def new(pointer_type, value = nil)
format(POINTERS[pointer_type], value)
end
end
end