Class: Cb::Models::ApplicationSchema::QuestionSchema
- Inherits:
-
Object
- Object
- Cb::Models::ApplicationSchema::QuestionSchema
- Defined in:
- lib/cb/models/implementations/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 = {}) ⇒ QuestionSchema
constructor
A new instance of QuestionSchema.
Constructor Details
#initialize(args = {}) ⇒ QuestionSchema
Returns a new instance of QuestionSchema.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/cb/models/implementations/application_schema.rb', line 42 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 << ApplicationSchema::AnswerSchema.new(aa) end end end end |
Instance Attribute Details
#answers ⇒ Object
Returns the value of attribute answers.
40 41 42 |
# File 'lib/cb/models/implementations/application_schema.rb', line 40 def answers @answers end |
#format ⇒ Object
Returns the value of attribute format.
40 41 42 |
# File 'lib/cb/models/implementations/application_schema.rb', line 40 def format @format end |
#id ⇒ Object
Returns the value of attribute id.
40 41 42 |
# File 'lib/cb/models/implementations/application_schema.rb', line 40 def id @id end |
#required ⇒ Object
Returns the value of attribute required.
40 41 42 |
# File 'lib/cb/models/implementations/application_schema.rb', line 40 def required @required end |
#text ⇒ Object
Returns the value of attribute text.
40 41 42 |
# File 'lib/cb/models/implementations/application_schema.rb', line 40 def text @text end |
#type ⇒ Object
Returns the value of attribute type.
40 41 42 |
# File 'lib/cb/models/implementations/application_schema.rb', line 40 def type @type end |