5 6 7 8 9 10
# File 'lib/serializers/folder_serializer.rb', line 5 def from_json(json) json = JSON.parse(json, symbolize_names: true) data = json[:data] || json attributes = data[:attributes] Folder.new(name: attributes[:name], id: data[:id]) end