Class: Twitter::GeoFactory
- Inherits:
-
Object
- Object
- Twitter::GeoFactory
- Defined in:
- lib/twitter/geo_factory.rb
Class Method Summary collapse
-
.new(geo = {}) ⇒ Twitter::Point, Twitter::Polygon
Instantiates a new geo object.
Class Method Details
.new(geo = {}) ⇒ Twitter::Point, Twitter::Polygon
Instantiates a new geo object
12 13 14 15 16 17 18 19 |
# File 'lib/twitter/geo_factory.rb', line 12 def self.new(geo={}) type = geo.delete('type') if type Twitter.const_get(type.capitalize.to_sym).new(geo) else raise ArgumentError, "argument must have a 'type' key" end end |