class GroupDocs::Questionnaire::Question
Constants
- TYPES
Attributes
@attr [Array<String>] acceptableValues
@attr [Array<Hash>] answers
@attr [Array<GroupDocs::Questionnaire::Question::Conditions>] conditions
@attr [String] def_answer
@attr [Array<String>] dimension
added in release 1.5.8
@attr [Boolean] disabled
@attr [String] field
@attr [String] hint
@attr [Integer] max_length
@attr [GroupDocs::Document::Rectangle] rect
added in release 1.7.0
@attr [String] regionName
@attr [Boolean] required
@attr [String] text
@attr [Symbol] type
Public Instance Methods
Adds answer to the question.
@param [GroupDocs::Questionnaire::Question::Answer] answer @raise [ArgumentError] if answer is not GroupDocs::Questionnaire::Question::Answer
object
# File lib/groupdocs/questionnaire/question.rb, line 75 def add_answer(answer) answer.is_a?(GroupDocs::Questionnaire::Question::Answer) or raise ArgumentError, "Answer should be GroupDocs::Questionnaire::Question::Answer object, received: #{answer.inspect}" @answers ||= Array.new @answers << answer end
Converts each answer to GroupDocs::Questionnaire::Question::Answer
object.
@param [Array<Hash>] answers
# File lib/groupdocs/questionnaire/question.rb, line 57 def answers=(answers) if answers @answers = answers.map do |answer| if answer.is_a?(GroupDocs::Questionnaire::Question::Answer) answer else Questionnaire::Question::Answer.new(answer) end end end end
Updates type with machine-readable format.
@param [Symbol] type @raise [ArgumentError] if type is unknown
# File lib/groupdocs/questionnaire/question.rb, line 89 def type=(type) if type.is_a?(Symbol) type = type.to_s.camelize TYPES.include?(type) or raise ArgumentError, "Unknown type: #{type.inspect}" end @type = type end