Class: AskAwesomely::Field::PictureChoice
- Inherits:
-
Field
- Object
- Field
- AskAwesomely::Field::PictureChoice
show all
- Defined in:
- lib/ask_awesomely/field/picture_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
25
26
27
|
# File 'lib/ask_awesomely/field/picture_choice.rb', line 25
def align_vertically
@state.vertical_alignment = true
end
|
#allow_multiple_selections ⇒ Object
9
10
11
|
# File 'lib/ask_awesomely/field/picture_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/picture_choice.rb', line 17
def can_specify_other
@state.add_other_choice = true
end
|
#choice(label, picture:) ⇒ Object
4
5
6
7
|
# File 'lib/ask_awesomely/field/picture_choice.rb', line 4
def choice(label, picture:)
@state.choices ||= []
@state.choices << Choice.new(label: label, picture: picture)
end
|
#randomize ⇒ Object
13
14
15
|
# File 'lib/ask_awesomely/field/picture_choice.rb', line 13
def randomize
@state.randomize = true
end
|
#show_labels ⇒ Object
21
22
23
|
# File 'lib/ask_awesomely/field/picture_choice.rb', line 21
def show_labels
@state.show_labels = true
end
|