Class: Spear::Structure::Job::Search
- Includes:
- EmbededClass
- Defined in:
- lib/spear/structure/job/search.rb
Instance Attribute Summary collapse
-
#jobs ⇒ Object
Returns the value of attribute jobs.
-
#tn_did ⇒ Object
readonly
Returns the value of attribute tn_did.
Attributes inherited from Base
#error_message, #response, #root, #status
Instance Method Summary collapse
-
#initialize(response) ⇒ Search
constructor
A new instance of Search.
Methods included from EmbededClass
Methods inherited from Base
Constructor Details
#initialize(response) ⇒ Search
Returns a new instance of Search.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/spear/structure/job/search.rb', line 10 def initialize(response) super(response) if response.class == HTTParty::Response @tn_did = response.request.[:query][:TalentNetworkDID] end job_search_result = @root['Results'].nil? ? [] : @root['Results']['JobSearchResult'] @jobs = generate_jobs(job_search_result, @tn_did) rescue nil end |
Instance Attribute Details
#jobs ⇒ Object
Returns the value of attribute jobs.
8 9 10 |
# File 'lib/spear/structure/job/search.rb', line 8 def jobs @jobs end |
#tn_did ⇒ Object (readonly)
Returns the value of attribute tn_did.
7 8 9 |
# File 'lib/spear/structure/job/search.rb', line 7 def tn_did @tn_did end |