lib/active_merchant/lib/country.rb in activemerchant-1.4.2 vs lib/active_merchant/lib/country.rb in activemerchant-1.5.0

- old
+ new

@@ -1,5 +1,8 @@ +#!ruby19 +# encoding: utf-8 + module ActiveMerchant #:nodoc: class InvalidCountryCodeError < StandardError end class CountryCodeFormatError < StandardError @@ -41,10 +44,10 @@ @name = options.delete(:name) @codes = options.collect{|k,v| CountryCode.new(v)} end def code(format) - @codes.select{|c| c.format == format} + @codes.find{|c| c.format == format} end def to_s @name end