Class: HtmlGrid::RichText

Inherits:
Component show all
Defined in:
lib/htmlgrid/richtext.rb

Constant Summary

Constants inherited from Component

Component::CSS_CLASS, Component::CSS_ID, Component::HTML_ATTRIBUTES, Component::HTTP_HEADERS, Component::LABEL

Instance Attribute Summary

Attributes inherited from Component

#attributes, #dojo_tooltip, #label, #model, #value

Instance Method Summary collapse

Methods inherited from Component

#_to_html, #autofill?, #css_class, #css_class=, #css_id, #css_id=, #dojo_dynamic_html, #dojo_parse_on_load, #dojo_tag, #dojo_title=, #dynamic_html, #escape, #escape_symbols, #formname, #http_headers, #initialize, #label?, #onclick=, #onload=, #onsubmit=, #set_attribute, #tabindex=

Constructor Details

This class inherits a constructor from HtmlGrid::Component

Instance Method Details

#<<(element) ⇒ Object



14
15
16
# File 'lib/htmlgrid/richtext.rb', line 14

def <<(element)
  @elements.push(element)
end

#initObject



9
10
11
12
# File 'lib/htmlgrid/richtext.rb', line 9

def init
  super
  @elements = []
end

#to_html(context) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/htmlgrid/richtext.rb', line 18

def to_html(context)
  @elements.collect { |element|
    if element.respond_to?(:to_html)
      element.to_html(context).force_encoding("utf-8")
    else
      element.to_s
    end
  }.join(" ")
end