File: timezones.rb

package info (click to toggle)
ruby-countries 4.2.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,196 kB
  • sloc: ruby: 2,085; makefile: 4
file content (13 lines) | stat: -rw-r--r-- 332 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
module ISO3166
  # Extend Country class with support for timezones. Requires the  {tzinfo}[https://github.com/tzinfo/tzinfo] gem
  #
  #   gem 'tzinfo'
  #
  module TimezoneExtensions
    def timezones
      @tz_country ||= TZInfo::Country.get(alpha2)
    end
  end
end

ISO3166::Country.send(:include, ISO3166::TimezoneExtensions)