Forked from robmckinnon/register-country-and-territory-list.rb
Last active
June 15, 2017 09:14
-
-
Save dankmitchell/c0c85adbc07649ab0bdf5660bd39baf7 to your computer and use it in GitHub Desktop.
Get sorted list of territory and country names excluding those with end_dates using Open Register Ruby client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add gem | |
gem 'openregister-ruby-client', git: 'https://github.com/openregister/openregister-ruby-client' | |
# Inside application.rb | |
require 'openregister-ruby' | |
c = OpenRegister.register('country', :beta)._all_records + | |
OpenRegister.register('territory', :beta)._all_records | |
c.select{|x| x.end_date.blank?}.map(&:name).sort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment