Class: DetailPanelItemHashController
- Inherits:
-
Shirka::Qt::TreeItemController
- Object
- Shirka::Controller
- Shirka::Qt::TreeItemController
- DetailPanelItemHashController
- Defined in:
- lib/troshka/detail_panel_item_hash/controller.rb
Instance Attribute Summary
Attributes inherited from Shirka::Controller
#app, #components, #data, #parent, #view
Instance Method Summary collapse
Methods inherited from Shirka::Qt::TreeItemController
#add_item, #id, #initialize, #item_controller_class, #on_component_adding, #on_double_clicked, #view, #view_class
Methods inherited from Shirka::Controller
#add_component, #add_item, #initialize, #item_controller_class, #on_component_added, #on_component_adding, #view_class
Methods included from Shirka::Eventalk
#add_watcher, #fire, #forward, #watch, #watchers
Constructor Details
This class inherits a constructor from Shirka::Qt::TreeItemController
Instance Method Details
#init(data) ⇒ Object
2 3 4 5 |
# File 'lib/troshka/detail_panel_item_hash/controller.rb', line 2 def init(data) @item_ids = {} data[1].each {|key, value| add_item [key, value], item_class(value)} end |
#item_class(obj) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/troshka/detail_panel_item_hash/controller.rb', line 7 def item_class(obj) name = obj.class.ancestors .map {|i| "DetailPanelItem#{i}Controller"} .find {|i| Object.const_get i rescue false} Object.const_get(name) end |