Class: WorldBankFetcher::CountryParser

Inherits:
Object
  • Object
show all
Defined in:
lib/world_bank_fetcher/country_parser.rb

Class Method Summary collapse

Class Method Details

.data_from_official_country?(datum) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/world_bank_fetcher/country_parser.rb', line 14

def self.data_from_official_country?(datum)
  !non_country_codes.include? datum.raw.country.id
end

.filter(data_collection) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/world_bank_fetcher/country_parser.rb', line 6

def self.filter(data_collection)
  if (data_collection.first.is_a? WorldBank::Country)
    filter_countries data_collection
  else
    filter_data_from_non_countries data_collection
  end        
end