Sha256: cb493000a8986443ec0b037a3d947a0315bac2d503face412b1732ecae66eea5
Contents?: true
Size: 889 Bytes
Versions: 51
Compression:
Stored size: 889 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 schema @child_datasource.schema 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
51 entries across 51 versions & 1 rubygems