Class: Shark::FormService::Form::MultipleChoice

Inherits:
Element
  • Object
show all
Defined in:
lib/shark/form_service/form/multiple_choice.rb

Instance Attribute Summary

Attributes inherited from Element

#children, #parent

Instance Method Summary collapse

Methods inherited from Element

#ancestors, #attribute_defined?, #attribute_definition, #attribute_definitions, #id, #initialize, #label, #text, #type

Constructor Details

This class inherits a constructor from Shark::FormService::Form::Element

Instance Method Details

#more_on_choice?Boolean

Returns:

  • (Boolean)


11
12
13
14
15
16
17
# File 'lib/shark/form_service/form/multiple_choice.rb', line 11

def more_on_choice?
  more_on_choice = attribute('more_on_choice')

  return values.include?(more_on_choice['value']) if more_on_choice.present?

  false
end

#valuesObject



7
8
9
# File 'lib/shark/form_service/form/multiple_choice.rb', line 7

def values
  element['valid_values']
end