Class: Cb::CbApplicationSchema
- Inherits:
-
Object
- Object
- Cb::CbApplicationSchema
- Defined in:
- lib/cb/models/implementations/cb_application_schema.rb
Overview
This general purpose object stores anything having to do with an application. The API objects dealing with application, will populate one or many of this object.
Defined Under Namespace
Classes: CbAnswerSchema, CbQuestionSchema
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 = {}) ⇒ CbApplicationSchema
constructor
A new instance of CbApplicationSchema.
Constructor Details
#initialize(args = {}) ⇒ CbApplicationSchema
Returns a new instance of CbApplicationSchema.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/cb/models/implementations/cb_application_schema.rb', line 12 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 << CbApplicationSchema::CbQuestionSchema.new(qq) end end end end |
Instance Attribute Details
#apply_url ⇒ Object
Returns the value of attribute apply_url.
8 9 10 |
# File 'lib/cb/models/implementations/cb_application_schema.rb', line 8 def apply_url @apply_url end |
#did ⇒ Object
Returns the value of attribute did.
8 9 10 |
# File 'lib/cb/models/implementations/cb_application_schema.rb', line 8 def did @did end |
#is_shared_apply ⇒ Object
Returns the value of attribute is_shared_apply.
8 9 10 |
# File 'lib/cb/models/implementations/cb_application_schema.rb', line 8 def is_shared_apply @is_shared_apply end |
#questions ⇒ Object
Returns the value of attribute questions.
8 9 10 |
# File 'lib/cb/models/implementations/cb_application_schema.rb', line 8 def questions @questions end |
#requirements ⇒ Object
Returns the value of attribute requirements.
8 9 10 |
# File 'lib/cb/models/implementations/cb_application_schema.rb', line 8 def requirements @requirements end |
#submit_service_url ⇒ Object
Returns the value of attribute submit_service_url.
8 9 10 |
# File 'lib/cb/models/implementations/cb_application_schema.rb', line 8 def submit_service_url @submit_service_url end |
#title ⇒ Object
Returns the value of attribute title.
8 9 10 |
# File 'lib/cb/models/implementations/cb_application_schema.rb', line 8 def title @title end |
#total_questions ⇒ Object
Returns the value of attribute total_questions.
8 9 10 |
# File 'lib/cb/models/implementations/cb_application_schema.rb', line 8 def total_questions @total_questions end |
#total_required_questions ⇒ Object
Returns the value of attribute total_required_questions.
8 9 10 |
# File 'lib/cb/models/implementations/cb_application_schema.rb', line 8 def total_required_questions @total_required_questions end |