require 'frozen_record' class CountryData::Data < FrozenRecord::Base self.base_path = 'lib' def self.find(arg) arg = arg.to_s.upcase if arg.class == Symbol where(alpha2: arg) end def self.find_by_official_language(arg) all.select { |c| c if c.languages_official.include? arg.to_s } end def self.continents all.collect(&:continent).uniq end private end