Class: Interview::Text
- Includes:
- HasControls
- Defined in:
- lib/interview/text.rb
Instance Attribute Summary collapse
-
#bold ⇒ Object
Returns the value of attribute bold.
-
#html_class ⇒ Object
Returns the value of attribute html_class.
-
#style ⇒ Object
Returns the value of attribute style.
-
#text ⇒ Object
Returns the value of attribute text.
Attributes included from HasControls
Attributes inherited from Control
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Text
constructor
A new instance of Text.
- #render ⇒ Object
Methods included from HasControls
#add_control, #add_controls, included, #siblings
Methods inherited from Control
#ancestors, build, definition, #find_attribute, #find_attribute!, inherited, #set_attributes, #set_defaults
Constructor Details
#initialize(params = {}) ⇒ Text
Returns a new instance of Text.
7 8 9 10 |
# File 'lib/interview/text.rb', line 7 def initialize(params={}) @html_class = [] super end |
Instance Attribute Details
#bold ⇒ Object
Returns the value of attribute bold.
5 6 7 |
# File 'lib/interview/text.rb', line 5 def bold @bold end |
#html_class ⇒ Object
Returns the value of attribute html_class.
5 6 7 |
# File 'lib/interview/text.rb', line 5 def html_class @html_class end |
#style ⇒ Object
Returns the value of attribute style.
5 6 7 |
# File 'lib/interview/text.rb', line 5 def style @style end |
#text ⇒ Object
Returns the value of attribute text.
5 6 7 |
# File 'lib/interview/text.rb', line 5 def text @text end |
Instance Method Details
#render ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/interview/text.rb', line 12 def render html = Builder::XmlMarkup.new if @style opts = {} opts[:class] = @html_class.join(' ') unless @html_class.empty? html.tag! @style.to_sym, opts do render_text(html) end else render_text(html) end return html.target! end |