Class: Factual::Query::Geopulse

Inherits:
Base
  • Object
show all
Defined in:
lib/factual/query/geopulse.rb

Instance Attribute Summary

Attributes inherited from Base

#action, #params, #path

Instance Method Summary collapse

Methods inherited from Base

#[], #each, #full_path, #last, #populate, #rows, #schema, #total_count

Constructor Details

#initialize(api, lat, lng, params = {}) ⇒ Geopulse

Returns a new instance of Geopulse.



6
7
8
9
10
11
12
13
14
# File 'lib/factual/query/geopulse.rb', line 6

def initialize(api, lat, lng, params={})
  @path = "places/geopulse"
  @action = :read
  @lat = lat
  @lng = lng

  @params = {:geo => {"$point" => [lat, lng]}}.merge(params)
  super(api, @params)
end

Instance Method Details

#select(*args) ⇒ Object



16
17
18
# File 'lib/factual/query/geopulse.rb', line 16

def select(*args)
  self.class.new(@api, @lat, @lng, :select => form_value(args))
end