Module: OMF::Web::Widget::Code
- Defined in:
- lib/omf-web/widget/UNUSED/code/code_widget.rb,
lib/omf-web/widget/UNUSED/code/code.rb,
lib/omf-web/widget/UNUSED/code/code.rb
Overview
require ‘ftools’
Defined Under Namespace
Classes: CodeWidget
Constant Summary collapse
- @@scripts =
[]
- @@sessions =
{}
Class Method Summary collapse
- .[](id) ⇒ Object
-
.addCode(name, opts = {}) ⇒ Object
Register a script which can be visualized through a
CodeWidget
. - .configure(options = {}) ⇒ Object
- .count ⇒ Object
- .each_with_index ⇒ Object
Class Method Details
.[](id) ⇒ Object
34 35 36 |
# File 'lib/omf-web/widget/UNUSED/code/code.rb', line 34 def self.[](id) @@scripts[id] end |
.addCode(name, opts = {}) ⇒ Object
Register a script which can be visualized through a CodeWidget
name - Name of script opts -
:???
26 27 28 29 30 31 32 |
# File 'lib/omf-web/widget/UNUSED/code/code.rb', line 26 def self.addCode(name, opts = {}) opts[:name] = name opts[:widget_class] = OMF::Web::Widget::Code::CodeWidget @@scripts << opts #CodeDescription.new(name, opts) opts end |
.configure(options = {}) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/omf-web/widget/UNUSED/code/code.rb', line 12 def self.configure( = {}) opts = .dup opts[:scripts] = @@scripts currDir = File.dirname(__FILE__) opts[:resourcePath].insert(0, currDir) end |
.count ⇒ Object
38 39 40 |
# File 'lib/omf-web/widget/UNUSED/code/code.rb', line 38 def self.count @@scripts.length end |
.each_with_index ⇒ Object
42 43 44 45 46 |
# File 'lib/omf-web/widget/UNUSED/code/code.rb', line 42 def self.each_with_index @@scripts.each_index do |i| yield @@scripts[i], i end end |