Class: Cb::CbApplicationSchema::CbQuestionSchema
- Inherits:
-
Object
- Object
- Cb::CbApplicationSchema::CbQuestionSchema
- Defined in:
- lib/cb/models/implementations/cb_application_schema.rb
Instance Attribute Summary collapse
-
#answers ⇒ Object
Returns the value of attribute answers.
-
#format ⇒ Object
Returns the value of attribute format.
-
#id ⇒ Object
Returns the value of attribute id.
-
#required ⇒ Object
Returns the value of attribute required.
-
#text ⇒ Object
Returns the value of attribute text.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ CbQuestionSchema
constructor
A new instance of CbQuestionSchema.
Constructor Details
#initialize(args = {}) ⇒ CbQuestionSchema
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/cb/models/implementations/cb_application_schema.rb', line 46 def initialize(args = {}) return if args.nil? @id = args['QuestionID'] || '' @type = args['QuestionType'] || '' @required = (args['IsRequired'].downcase == 'true') @format = args['ExpectedResponseFormat'] || '' @text = args['QuestionText'] || '' @answers = [] if args.has_key?('Answers') unless args['Answers'].empty? args['Answers']['Answer'].each do | aa | @answers << CbApplicationSchema::CbAnswerSchema.new(aa) end end end end |
Instance Attribute Details
#answers ⇒ Object
Returns the value of attribute answers.
44 45 46 |
# File 'lib/cb/models/implementations/cb_application_schema.rb', line 44 def answers @answers end |
#format ⇒ Object
Returns the value of attribute format.
44 45 46 |
# File 'lib/cb/models/implementations/cb_application_schema.rb', line 44 def format @format end |
#id ⇒ Object
Returns the value of attribute id.
44 45 46 |
# File 'lib/cb/models/implementations/cb_application_schema.rb', line 44 def id @id end |
#required ⇒ Object
Returns the value of attribute required.
44 45 46 |
# File 'lib/cb/models/implementations/cb_application_schema.rb', line 44 def required @required end |
#text ⇒ Object
Returns the value of attribute text.
44 45 46 |
# File 'lib/cb/models/implementations/cb_application_schema.rb', line 44 def text @text end |
#type ⇒ Object
Returns the value of attribute type.
44 45 46 |
# File 'lib/cb/models/implementations/cb_application_schema.rb', line 44 def type @type end |