Restcountry
This is a Ruby wrapper library around the API provided by REST Countries http://restcountries.eu
Install / Use
/learn @davidesantangelo/RestcountryREADME
Restcountry
This is a RubyGem wrapper library around the API provided by Restcountries.
Installation
Add this line to your application's Gemfile:
gem 'restcountry'
And then execute:
$ bundle
Or install it yourself as:
$ gem install restcountry
Usage
require 'restcountry'
# Find all countries
countries = Restcountry::Country.all
# Find a country by name
country = Restcountry::Country.find_by_name('italy')
# Access the country's attributes
country.capital
#=> Rome
country.region
#=> Europe
country.callingCodes
#=> "39"
# Find a country by capital
country = Restcountry::Country.find_by_capital('Rome')
country.name
#=> Italy
countries = Restcountry::Country.find_by_lang('it')
countries.first
#=> Holy See
Attributes
name, capital, altSpellings, relevance, region, subregion, translations, population, latlng, demonym, area, gini, timezones, borders, nativeName, callingCodes, topLevelDomain, alpha2Code, alpha3Code, currencies, languages
Credits
Many thanks to Fayder Florez for his implementation of the API.
Contributors
<a href="https://github.com/davidesantangelo/restcountry/contributors">All Contributors</a>
Related projects
License
The restcountry GEM is released under the MIT License.
Related Skills
node-connect
351.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
