Sha256: 8b7fd16e193efaf90d364d72041ba196d8db0e4681874d972bbe57f963f7864b
Contents?: true
Size: 702 Bytes
Versions: 40
Compression:
Stored size: 702 Bytes
Contents
module Scrivito class ObjUiConfig < Struct.new(:obj) def self.mget(workspace, obj_ids) objs = workspace.objs.find_including_deleted(obj_ids) obj_ids.map do |obj_id| ObjUiConfig.new(objs.find { |obj| obj.id == obj_id }) end end def as_json return {} unless obj { description_for_editor: obj.description_for_editor, info_for_content_browser: obj.try(:info_for_content_browser), description_for_widgets: description_for_widgets, } end private def description_for_widgets obj.widgets.each_with_object({}) do |widget, h| h[widget.id] = widget.description_for_editor end end end end
Version data entries
40 entries across 40 versions & 1 rubygems