Class: AskAwesomely::Field::PictureChoice

Inherits:
Field
  • Object
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

Methods included from JsonBuilder

#build_json

Constructor Details

This class inherits a constructor from AskAwesomely::Field::Field

Instance Method Details

#align_verticallyObject



25
26
27
# File 'lib/ask_awesomely/field/picture_choice.rb', line 25

def align_vertically
  @state.vertical_alignment = true
end

#allow_multiple_selectionsObject



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_otherObject



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

#randomizeObject



13
14
15
# File 'lib/ask_awesomely/field/picture_choice.rb', line 13

def randomize
  @state.randomize = true
end

#show_labelsObject



21
22
23
# File 'lib/ask_awesomely/field/picture_choice.rb', line 21

def show_labels
  @state.show_labels = true
end