Class: MotionForm::Section

Inherits:
Object
  • Object
show all
Defined in:
lib/project/section/section.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title = '') ⇒ Section

Returns a new instance of Section.



8
9
10
# File 'lib/project/section/section.rb', line 8

def initialize(title = '')
  @title = title
end

Instance Attribute Details

#titleObject (readonly)

Returns the value of attribute title.



6
7
8
# File 'lib/project/section/section.rb', line 6

def title
  @title
end

Instance Method Details

#button(key, options = {}) ⇒ Object



20
21
22
# File 'lib/project/section/section.rb', line 20

def button(key, options = {})
  rows << ButtonRow.new(key, options)
end

#input(key, options = {}) ⇒ Object



12
13
14
# File 'lib/project/section/section.rb', line 12

def input(key, options = {})
  rows << TextInputRow.new(key, options)
end

#rowsObject



24
25
26
# File 'lib/project/section/section.rb', line 24

def rows
  @rows ||= []
end

#text(key, options = {}) ⇒ Object



16
17
18
# File 'lib/project/section/section.rb', line 16

def text(key, options = {})
  rows << TextFieldRow.new(key, options)
end