Class: OMF::Web::Widget::Text::Maruku::WidgetElement
- Inherits:
-
Object
- Object
- OMF::Web::Widget::Text::Maruku::WidgetElement
- Defined in:
- lib/omf-web/widget/text/maruku.rb
Instance Attribute Summary collapse
-
#widget ⇒ Object
readonly
Returns the value of attribute widget.
Instance Method Summary collapse
-
#initialize(wdescr) ⇒ WidgetElement
constructor
A new instance of WidgetElement.
- #node_type ⇒ Object
- #to_html ⇒ Object
Constructor Details
#initialize(wdescr) ⇒ WidgetElement
Returns a new instance of WidgetElement.
44 45 46 47 |
# File 'lib/omf-web/widget/text/maruku.rb', line 44 def initialize(wdescr) @wdescr = wdescr @widget = OMF::Web::Widget.(wdescr) end |
Instance Attribute Details
#widget ⇒ Object (readonly)
Returns the value of attribute widget.
42 43 44 |
# File 'lib/omf-web/widget/text/maruku.rb', line 42 def @widget end |
Instance Method Details
#node_type ⇒ Object
58 59 60 |
# File 'lib/omf-web/widget/text/maruku.rb', line 58 def node_type :widget end |
#to_html ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'lib/omf-web/widget/text/maruku.rb', line 49 def to_html content = @widget.content h = content.to_html if title = @widget.title h += "<div class='caption'>#{title}</div>" end ::REXML::Document.new("<div class='embedded'>#{h}</div>").root end |