Class: Cb::Models::ApplicationSchema
- Inherits:
-
Object
- Object
- Cb::Models::ApplicationSchema
- Defined in:
- lib/cb/models/implementations/application_schema.rb
Defined Under Namespace
Classes: AnswerSchema, QuestionSchema
Instance Attribute Summary collapse
-
#apply_url ⇒ Object
Returns the value of attribute apply_url.
-
#did ⇒ Object
Returns the value of attribute did.
-
#is_shared_apply ⇒ Object
Returns the value of attribute is_shared_apply.
-
#questions ⇒ Object
Returns the value of attribute questions.
-
#requirements ⇒ Object
Returns the value of attribute requirements.
-
#submit_service_url ⇒ Object
Returns the value of attribute submit_service_url.
-
#title ⇒ Object
Returns the value of attribute title.
-
#total_questions ⇒ Object
Returns the value of attribute total_questions.
-
#total_required_questions ⇒ Object
Returns the value of attribute total_required_questions.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ ApplicationSchema
constructor
A new instance of ApplicationSchema.
Constructor Details
#initialize(args = {}) ⇒ ApplicationSchema
Returns a new instance of ApplicationSchema.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/cb/models/implementations/application_schema.rb', line 8 def initialize(args = {}) return if args.nil? # Job Info related @did = args['JobDID'] || '' @title = args['JobTitle'] || '' @requirements = args['Requirements'] || '' # Apply URL related @submit_service_url = args['ApplicationSubmitServiceURL'] || '' @apply_url = args['ApplyURL'] || '' @is_shared_apply = (args['IsSharedApply'].downcase == 'true') # Question related @total_questions = args['TotalQuestions'] || '' @total_required_questions = args['TotalRequiredQuestions'] || '' @total_questions = @total_questions.to_i if Cb::Utils::Api.is_numeric? @total_questions @total_required_questions = @total_required_questions.to_i if Cb::Utils::Api.is_numeric? @total_required_questions @questions = [] if args.has_key?('Questions') unless args['Questions'].empty? args['Questions']['Question'].each do | qq | @questions << ApplicationSchema::QuestionSchema.new(qq) end end end end |
Instance Attribute Details
#apply_url ⇒ Object
Returns the value of attribute apply_url.
4 5 6 |
# File 'lib/cb/models/implementations/application_schema.rb', line 4 def apply_url @apply_url end |
#did ⇒ Object
Returns the value of attribute did.
4 5 6 |
# File 'lib/cb/models/implementations/application_schema.rb', line 4 def did @did end |
#is_shared_apply ⇒ Object
Returns the value of attribute is_shared_apply.
4 5 6 |
# File 'lib/cb/models/implementations/application_schema.rb', line 4 def is_shared_apply @is_shared_apply end |
#questions ⇒ Object
Returns the value of attribute questions.
4 5 6 |
# File 'lib/cb/models/implementations/application_schema.rb', line 4 def questions @questions end |
#requirements ⇒ Object
Returns the value of attribute requirements.
4 5 6 |
# File 'lib/cb/models/implementations/application_schema.rb', line 4 def requirements @requirements end |
#submit_service_url ⇒ Object
Returns the value of attribute submit_service_url.
4 5 6 |
# File 'lib/cb/models/implementations/application_schema.rb', line 4 def submit_service_url @submit_service_url end |
#title ⇒ Object
Returns the value of attribute title.
4 5 6 |
# File 'lib/cb/models/implementations/application_schema.rb', line 4 def title @title end |
#total_questions ⇒ Object
Returns the value of attribute total_questions.
4 5 6 |
# File 'lib/cb/models/implementations/application_schema.rb', line 4 def total_questions @total_questions end |
#total_required_questions ⇒ Object
Returns the value of attribute total_required_questions.
4 5 6 |
# File 'lib/cb/models/implementations/application_schema.rb', line 4 def total_required_questions @total_required_questions end |