Class: Interview::Space

Inherits:
Control show all
Defined in:
lib/interview/space.rb

Instance Attribute Summary collapse

Attributes inherited from Control

#parent

Instance Method Summary collapse

Methods inherited from Control

#ancestors, build, definition, #find_attribute, #find_attribute!, inherited, #initialize, #set_attributes, #set_defaults

Constructor Details

This class inherits a constructor from Interview::Control

Instance Attribute Details

#styleObject

Returns the value of attribute style.



3
4
5
# File 'lib/interview/space.rb', line 3

def style
  @style
end

Instance Method Details

#renderObject



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/interview/space.rb', line 5

def render
  html = Builder::XmlMarkup.new
  if @style and @style.to_sym == :line
    html.hr
  elsif @style and @style.to_sym == :break
    html.br
  else
    html.text! ' '
  end
  return html.target!
end