Module: Quby::Questionnaires::DSL::QuestionBuilder

Includes:
Helpers
Defined in:
lib/quby/questionnaires/dsl/question_builder.rb

Constant Summary collapse

BUILDERS =
{
  'string'    => Questions::StringQuestionBuilder,
  'textarea'  => Questions::TextQuestionBuilder,
  'integer'   => Questions::IntegerQuestionBuilder,
  'float'     => Questions::FloatQuestionBuilder,
  'radio'     => Questions::RadioQuestionBuilder,
  'scale'     => Questions::RadioQuestionBuilder,
  'select'    => Questions::SelectQuestionBuilder,
  'check_box' => Questions::CheckboxQuestionBuilder,
  'date'      => Questions::DateQuestionBuilder,
  'hidden'    => Questions::DeprecatedQuestionBuilder
}

Class Method Summary collapse

Methods included from Helpers

#check_question_keys_uniqueness, #image_alt, #image_tag, #video_tag

Class Method Details

.build(key, options = {}, &block) ⇒ Object



34
35
36
# File 'lib/quby/questionnaires/dsl/question_builder.rb', line 34

def self.build(key, options = {}, &block)
  BUILDERS.fetch(options.fetch(:type).to_s).build(key, options, &block)
end