RDFLib / pyLDAPI

A very small module to add Linked Data API functionality to a Python Flask installation
BSD 3-Clause "New" or "Revised" License
41 stars 11 forks source link

Refactor pyLDAPI.Renderer.render() #9

Open edmondchuc opened 5 years ago

edmondchuc commented 5 years ago

"I will be looking into refactoring parts of the pyLDAPI – more specifically the current requirement of using pyldapi.Renderer._render_alternates_view() for custom Renderer classes. If it’s required to be called manually, it should ideally drop the prefix underscore. Otherwise see if it’s possible to refactor it to the behaviour of the RegisterRenderer class where it’s handled automatically by the tool. "

Here is a live example of a possible solution where the end result will allow the business code to just call SomeClassRenderer.render(): https://repl.it/@edmondchuc/pyLDAPI-Renderer-class-refactor-example

This will keep it in line with the usage of the pyldapi.RegisterRenderer.render().