Class: Apps::Outlook::Schema::MultichoiceInput

Inherits:
Input
  • Object
show all
Defined in:
lib/apps/outlook/schema/multichoice_input.rb

Overview

Constant Summary collapse

STYLES =
%w[normal expanded].freeze

Instance Attribute Summary collapse

Attributes inherited from Input

#id, #required, #title, #value

Instance Method Summary collapse

Instance Attribute Details

#multipleObject

Boolean - whether to allow selecting multiple choices



10
11
12
# File 'lib/apps/outlook/schema/multichoice_input.rb', line 10

def multiple
  @multiple
end

#styleObject

Boolean - whether to allow selecting multiple choices



10
11
12
# File 'lib/apps/outlook/schema/multichoice_input.rb', line 10

def style
  @style
end

Instance Method Details

#add_choice(name, value) ⇒ Object



26
27
28
# File 'lib/apps/outlook/schema/multichoice_input.rb', line 26

def add_choice(name, value)
  choices[name] = value
end

#choicesObject

normal - dropdown expanded - radio button list



14
15
16
# File 'lib/apps/outlook/schema/multichoice_input.rb', line 14

def choices
  @choices ||= {}
end

#serializeObject



18
19
20
21
22
23
24
# File 'lib/apps/outlook/schema/multichoice_input.rb', line 18

def serialize
  super.merge(
    "isMultiSelect" => multiple,
    "style" => style,
    "choices" => serialize_hash(choices, key: 'display')
  )
end