Class: Interview::Space

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

Instance Attribute Summary collapse

Attributes inherited from Control

#parent

Instance Method Summary collapse

Methods inherited from Control

#ancestors, #build_child, #build_with_params, #find_attribute, #find_attribute!, #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.



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

def style
  @style
end

Instance Method Details

#build(b) ⇒ Object



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

def build(b)
  if @style and @style.to_sym == :line
    b << '<hr />'
  elsif @style and @style.to_sym == :break
    b << '<br />'
  else
    b << ' '
  end
end