Sha256: 7ebf77e9d2512f4dcc63b9af4b956eb752109e5123b0772ce4bd99334708c360
Contents?: true
Size: 918 Bytes
Versions: 20
Compression:
Stored size: 918 Bytes
Contents
module OMF::Web; module Widget; module Code end; end; end require 'omf-web/widget/code/code_widget' module OMF::Web::Widget::Code @@scripts = [] @@sessions = {} def self.configure(options = {}) opts = options.dup opts[:scripts] = @@scripts currDir = File.dirname(__FILE__) opts[:resourcePath].insert(0, currDir) end # Register a script which can be visualized through a +CodeWidget+ # # name - Name of script # opts - # :??? # def self.addCode(name, opts = {}) opts[:name] = name opts[:widget_class] = OMF::Web::Widget::Code::CodeWidget @@scripts << opts #CodeDescription.new(name, opts) opts end def self.[](id) @@scripts[id] end def self.count @@scripts.length end def self.each_with_index @@scripts.each_index do |i| yield @@scripts[i], i end end end # OMF::Web::Widget::Code
Version data entries
20 entries across 20 versions & 1 rubygems