Class: Geoiq::Analysis

Inherits:
BaseModel show all
Defined in:
lib/geoiq/analysis.rb

Instance Attribute Summary

Attributes inherited from BaseModel

#auth, #json

Instance Method Summary collapse

Methods inherited from BaseModel

api_methods, crud

Constructor Details

#initialize(auth, options = {}) ⇒ Analysis

Returns a new instance of Analysis.



5
6
7
# File 'lib/geoiq/analysis.rb', line 5

def initialize(auth, options={})
  super
end

Instance Method Details

#create(options = {}) ⇒ Object



9
10
11
12
13
14
# File 'lib/geoiq/analysis.rb', line 9

def create(options={})
  response = request(:post, "/analysis.json", {:query => options})
  id =  response.headers["location"].match(/(\d+)\.json/)[1].to_i
  
  return  Geoiq::Dataset.new(auth).find(id)
end