Class: AskAwesomely::Field::Dropdown

Inherits:
Field
  • Object
show all
Defined in:
lib/ask_awesomely/field/dropdown.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

#choice(label) ⇒ Object



4
5
6
7
# File 'lib/ask_awesomely/field/dropdown.rb', line 4

def choice(label)
  @state.choices ||= []
  @state.choices << Choice.new(label: label)
end

#in_alphabetical_orderObject



9
10
11
# File 'lib/ask_awesomely/field/dropdown.rb', line 9

def in_alphabetical_order
  @state.alphabetical_order = true
end