Class: OMF::Web::Widget::Layout::OneColumnLayout
- Inherits:
-
AbstractWidget
- Object
- Erector::Widget
- AbstractWidget
- OMF::Web::Widget::Layout::OneColumnLayout
- Defined in:
- lib/omf-web/widget/layout/one_column_layout.rb
Overview
Implements a layout which displays contained widgets in a single columns.
Instance Attribute Summary
Attributes inherited from AbstractWidget
#opts, #widget_id, #widget_type
Instance Method Summary collapse
- #collect_data_sources(ds_set) ⇒ Object
- #content ⇒ Object
-
#initialize(opts) ⇒ OneColumnLayout
constructor
A new instance of OneColumnLayout.
- #layout? ⇒ Boolean
- #name ⇒ Object
Methods inherited from AbstractWidget
#mime_type, #title, #tools_menu, #widget_info
Constructor Details
#initialize(opts) ⇒ OneColumnLayout
Returns a new instance of OneColumnLayout.
9 10 11 12 |
# File 'lib/omf-web/widget/layout/one_column_layout.rb', line 9 def initialize(opts) super opts @widgets = (opts[:widgets] || []).map {|w| OMF::Web::Widget.(w)} end |
Instance Method Details
#collect_data_sources(ds_set) ⇒ Object
19 20 21 22 |
# File 'lib/omf-web/widget/layout/one_column_layout.rb', line 19 def collect_data_sources(ds_set) @widgets.each {|w| w.collect_data_sources(ds_set) } ds_set end |
#content ⇒ Object
14 15 16 17 |
# File 'lib/omf-web/widget/layout/one_column_layout.rb', line 14 def content() OMF::Web::Theme.require 'one_column_renderer' OMF::Web::Theme::OneColumnRenderer.new(@widgets, @opts) end |
#layout? ⇒ Boolean
28 29 30 |
# File 'lib/omf-web/widget/layout/one_column_layout.rb', line 28 def layout? return true end |
#name ⇒ Object
24 25 26 |
# File 'lib/omf-web/widget/layout/one_column_layout.rb', line 24 def name @opts[:name] || @opts[:title] end |