Class: Cb::Models::JobResults

Inherits:
Object
  • Object
show all
Defined in:
lib/cb/models/implementations/job_results.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args_hash, job_hashes) ⇒ JobResults

Returns a new instance of JobResults.



5
6
7
8
9
10
11
12
13
14
# File 'lib/cb/models/implementations/job_results.rb', line 5

def initialize(args_hash, job_hashes)
  @args_hash = args_hash
  @jobs = extract_jobs(job_hashes)
  @total_count = args_hash['TotalCount']
  @last_item_index = args_hash['LastItemIndex']
  @city = args_hash['City']
  @state_code = args_hash['StateCode']
  @postal_code = args_hash['PostalCode']
  @search_location = args_hash['SearchMetaData']['SearchLocations']['SearchLocation'] rescue nil
end

Instance Attribute Details

#args_hashObject (readonly)

Returns the value of attribute args_hash.



4
5
6
# File 'lib/cb/models/implementations/job_results.rb', line 4

def args_hash
  @args_hash
end

#cityObject (readonly)

Returns the value of attribute city.



4
5
6
# File 'lib/cb/models/implementations/job_results.rb', line 4

def city
  @city
end

#jobsObject (readonly)

Returns the value of attribute jobs.



4
5
6
# File 'lib/cb/models/implementations/job_results.rb', line 4

def jobs
  @jobs
end

#last_item_indexObject (readonly)

Returns the value of attribute last_item_index.



4
5
6
# File 'lib/cb/models/implementations/job_results.rb', line 4

def last_item_index
  @last_item_index
end

#postal_codeObject (readonly)

Returns the value of attribute postal_code.



4
5
6
# File 'lib/cb/models/implementations/job_results.rb', line 4

def postal_code
  @postal_code
end

#search_locationObject (readonly)

Returns the value of attribute search_location.



4
5
6
# File 'lib/cb/models/implementations/job_results.rb', line 4

def search_location
  @search_location
end

#state_codeObject (readonly)

Returns the value of attribute state_code.



4
5
6
# File 'lib/cb/models/implementations/job_results.rb', line 4

def state_code
  @state_code
end

#total_countObject (readonly)

Returns the value of attribute total_count.



4
5
6
# File 'lib/cb/models/implementations/job_results.rb', line 4

def total_count
  @total_count
end