Module: UIC
- Defined in:
- lib/ruic.rb
Defined Under Namespace
Modules: ElementBacked, FileBacked, PresentableHash, XMLFileBacked Classes: Application, Behavior, Effect, MetaData, Presentation, Property, RenderPlugin, SlideCollection, SlideValues, StateMachine, ValuesPerSlide
Class Method Summary collapse
- .Application(metadata, uia_path = nil) ⇒ UIC::Application
- .MetaData(metadata_path) ⇒ Object
-
.Presentation(uip_path = nil) ⇒ Presentation
Shortcut for
UIC::Presentation.new. - .StateMachine(scxml_path) ⇒ Object
-
.tree_hierarchy(root, &children) ⇒ Array<Array>
Create an array of rows representing a tree of elements.
Class Method Details
.Application(metadata, uia_path = nil) ⇒ UIC::Application
214 215 216 |
# File 'lib/ruic/application.rb', line 214 def Application(,uia_path=nil) UIC::Application.new( , uia_path ) end |
.MetaData(metadata_path) ⇒ Object
355 356 357 358 |
# File 'lib/ruic/assets.rb', line 355 def UIC.MetaData() raise %Q{Cannot find MetaData.xml at "#{metadata_path}"} unless File.exist?() UIC::MetaData.new(File.read(,encoding:'utf-8')) end |
.Presentation(uip_path = nil) ⇒ Presentation
Returns Shortcut for UIC::Presentation.new.
642 643 644 |
# File 'lib/ruic/presentation.rb', line 642 def UIC.Presentation( uip_path=nil ) UIC::Presentation.new( uip_path ) end |
.StateMachine(scxml_path) ⇒ Object
11 12 13 14 |
# File 'lib/ruic/statemachine.rb', line 11 def UIC.StateMachine( scxml_path ) UIC::StateMachine.new(File.read(scxml_path,encoding:'utf-8')) .tap{ |o| o.file = scxml_path } end |
.tree_hierarchy(root, &children) ⇒ Array<Array>
Create an array of rows representing a tree of elements.
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/ruic/interfaces.rb', line 124 def UIC.tree_hierarchy( root, &children ) queue = [[root,"",true]] [].tap do |results| until queue.empty? item,indent,last = queue.pop kids = children[item] extra = indent.empty? ? '' : last ? '\\-' : '|-' results << [ indent+extra, item ] results << [ indent, nil ] if last and kids.empty? indent += last ? ' ' : '| ' parts = kids.map{ |k| [k,indent,false] }.reverse parts.first[2] = true unless parts.empty? queue.concat parts end end end |