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.



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

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

Instance Attribute Details

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end

Instance Method Details

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



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

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

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



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

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

#rowsObject



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

def rows
  @rows ||= []
end

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



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

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