Skip to content

Instantly share code, notes, and snippets.

@robmckinnon
Created December 8, 2016 11:06
Show Gist options
  • Save robmckinnon/739c5269814d13ff23a17f49f3737b77 to your computer and use it in GitHub Desktop.
Save robmckinnon/739c5269814d13ff23a17f49f3737b77 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
require 'openregister-ruby'
c = OpenRegister.register('country', :beta)._all_records +
OpenRegister.register('territory', :alpha)._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