Class: WorldBankFetcher::Job
- Inherits:
-
Object
- Object
- WorldBankFetcher::Job
- Defined in:
- lib/world_bank_fetcher/job.rb
Instance Attribute Summary collapse
-
#checksum ⇒ Object
readonly
Returns the value of attribute checksum.
-
#results ⇒ Object
readonly
Returns the value of attribute results.
Instance Method Summary collapse
- #fetch ⇒ Object
-
#initialize(options) ⇒ Job
constructor
A new instance of Job.
Constructor Details
#initialize(options) ⇒ Job
Returns a new instance of Job.
7 8 9 10 11 12 |
# File 'lib/world_bank_fetcher/job.rb', line 7 def initialize() @results = nil @checksum = nil @job_type = [:indicator] ? :indicator : :country @query = build_query end |
Instance Attribute Details
#checksum ⇒ Object (readonly)
Returns the value of attribute checksum.
5 6 7 |
# File 'lib/world_bank_fetcher/job.rb', line 5 def checksum @checksum end |
#results ⇒ Object (readonly)
Returns the value of attribute results.
5 6 7 |
# File 'lib/world_bank_fetcher/job.rb', line 5 def results @results end |
Instance Method Details
#fetch ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/world_bank_fetcher/job.rb', line 14 def fetch all_data = fetch_everything query if all_data data = (@job_type == :country) ? CountryParser.filter(all_data) : IndicatorDataParser.filter(all_data) data else nil end end |