Class: AskAwesomely::Field::MultipleChoice
- Inherits:
-
Field
- Object
- Field
- AskAwesomely::Field::MultipleChoice
show all
- Defined in:
- lib/ask_awesomely/field/multiple_choice.rb
Constant Summary
Constants inherited
from Field
Field::VALID_FIELD_TYPES
Instance Attribute Summary
Attributes inherited from Field
#state
Instance Method Summary
collapse
Methods inherited from Field
#ask, #description, #initialize, of_type, #ref, #required, #skip, #tags
#build_json
Instance Method Details
#align_vertically ⇒ Object
21
22
23
|
# File 'lib/ask_awesomely/field/multiple_choice.rb', line 21
def align_vertically
@state.vertical_alignment = true
end
|
#allow_multiple_selections ⇒ Object
9
10
11
|
# File 'lib/ask_awesomely/field/multiple_choice.rb', line 9
def allow_multiple_selections
@state.allow_multiple_selections = true
end
|
#can_specify_other ⇒ Object
17
18
19
|
# File 'lib/ask_awesomely/field/multiple_choice.rb', line 17
def can_specify_other
@state.add_other_choice = true
end
|
#choice(label) ⇒ Object
4
5
6
7
|
# File 'lib/ask_awesomely/field/multiple_choice.rb', line 4
def choice(label)
@state.choices ||= []
@state.choices << Choice.new(label: label)
end
|
#randomize ⇒ Object
13
14
15
|
# File 'lib/ask_awesomely/field/multiple_choice.rb', line 13
def randomize
@state.randomize = true
end
|