class FlowCommerce::Reference::Countries
Constants
- ISO_3166_2
Public Class Methods
find(country_code)
click to toggle source
# File lib/flowcommerce-reference.rb, line 28 def find(country_code) code = country_code.to_s.downcase.gsub(/[^\w]/,"").capitalize return nil unless [2,3].include?(code.length) return nil unless Data.respond_to?(code) Data.send(code) end
find!(country_code)
click to toggle source
# File lib/flowcommerce-reference.rb, line 35 def find!(country_code) find(country_code) || raise(ArgumentError, 'Country "%s" is not found' % country_code) end