Skip to content

Provide helpers and selectors for an English country and language list based on a csv file.

License

Notifications You must be signed in to change notification settings

smart-village-solutions/csv_country_selector_en

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CsvCountrySelectorEn

Provide helpers and selectors for an English country and language list based on a csv file.

Based on: https://github.com/ikuseiGmbH/csv_country_selector

Installation

Add this line to your application's Gemfile:

gem 'csv_country_selector_en'

And then execute:

$ bundle

Or install it yourself as:

$ gem install csv_country_selector_en

Usage

CsvCountrySelectorEn::Country.short_for("Germany") => "DE"
CsvCountrySelectorEn::Country.long_for("DE") => "Germany"
CsvCountrySelectorEn::Country.short_list => ["DE", "DK", "EE", ...]
CsvCountrySelectorEn::Country.long_list => ["Germany", "Denmark", "Estonia", ...]
CsvCountrySelectorEn::Country.codes => { de: "Germany", dk: "Denmark", ee: "Estonia", ... }
CsvCountrySelectorEn::Country.is_in_eu?("de") => true
CsvCountrySelectorEn::Country.is_in_eu?("DE") => true
CsvCountrySelectorEn::Country.is_in_eu?("US") => false

Development

Contributing

License

The gem is available as open source under the terms of the MIT License.

About

Provide helpers and selectors for an English country and language list based on a csv file.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published