permeate = (provider, client) ->
for k of provider
if provider.hasOwnProperty(k)
permeate = (provider, client) ->
for k of provider
if provider.hasOwnProperty(k)
console.log(“permeate() #{provider.constructor.name}.#{k} to”,client.constructor.name)
client[k] = provider[k]
class NoorPlugin
constructor: (@noodb, @app) ->
@log = @noodb.log
@cache_resources()
if @init_plugin
@init_plugin()
cache_resources: (resource_names) ->
if @_resources_to_cache?
for name in @_resources_to_cache
uri = "nrn:#{name}"
TODO make these direct links to the resources, for speed
@[name] = uri
init_plugin: ->
(exports ? this).NoorPlugin = NoorPlugin
(exports ? this).permeate = permeate