class Interview::Text

Attributes

html_safe[RW]
style[RW]
text[RW]

Public Instance Methods

build(b) { || ... } click to toggle source
# File lib/interview/controls/text.rb, line 8
def build(b)
  if @style
    b.section style: @style, html_class: @html_class, html_options: @html_options do
      build_text(b)
      yield if block_given?
    end
  else
    build_text(b)
    yield if block_given?
  end
end

Protected Instance Methods

build_text(b) click to toggle source
# File lib/interview/controls/text.rb, line 22
def build_text(b)
  if @text
    if @html_safe
      b.html << @text
    else
      b.html.text! @text
    end
  end
end