lib/uncharted/country.rb in uncharted-0.0.7.beta1 vs lib/uncharted/country.rb in uncharted-0.0.8
- old
+ new
@@ -17,24 +17,27 @@
def self.count
countries.count
end
- def self.find(codes)
- if codes.is_a? Array
- return codes.collect {|c| data[c]}
+ def self.find(objects)
+ case objects
+ when Array
+ objects.collect {|c| data[c]}
+ when Country
+ objects
+ else
+ data[objects]
end
- data[codes]
end
def self.countries
@data.values
end
-
+
def self.data
@data ||= {}
end
-
end
end
\ No newline at end of file