Sha256: d334a22fd03f2496f16036951e4667cd6de01411c7113453ad469bfd019dbc14
Contents?: true
Size: 828 Bytes
Versions: 17
Compression:
Stored size: 828 Bytes
Contents
module ForestAdminDatasourceToolkit module Decorators class DatasourceDecorator def initialize(child_datasource, collection_decorator_class) @child_datasource = child_datasource @collection_decorator_class = collection_decorator_class @decorators = {} end def collections @child_datasource.collections.transform_values { |c| get_collection(c.name) } end def get_collection(name) collection = @child_datasource.get_collection(name) unless @decorators.key?(collection.name) @decorators[collection.name] = @collection_decorator_class.new(collection, self) end @decorators[collection.name] end def render_chart(caller, name) @child_datasource.render_chart(caller, name) end end end end
Version data entries
17 entries across 17 versions & 1 rubygems