Class: Nextstop

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/nextstop.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key) ⇒ Nextstop

Returns a new instance of Nextstop.



20
21
22
# File 'lib/nextstop.rb', line 20

def initialize(api_key)
  self.api_key = api_key
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



18
19
20
# File 'lib/nextstop.rb', line 18

def api_key
  @api_key
end

Instance Method Details

#guide(guide_id, options = {}) ⇒ Object



40
41
42
# File 'lib/nextstop.rb', line 40

def guide(guide_id, options={})
  mashup(self.class.get("/guide/#{guide_id}/", :query => default_options.merge(options)))
end

#place(place_id, options = {}) ⇒ Object



36
37
38
# File 'lib/nextstop.rb', line 36

def place(place_id, options={})
  mashup(self.class.get("/p/#{place_id}/", :query => default_options.merge(options)))
end

#search(options = {}) ⇒ Object



24
25
26
# File 'lib/nextstop.rb', line 24

def search(options={})
  mashup(self.class.get("/search/", :query => default_options.merge(options)))
end

#search_guides(options = {}) ⇒ Object



28
29
30
# File 'lib/nextstop.rb', line 28

def search_guides(options={})
  search options.merge({:result_type => 'guides'})
end

#search_places(options = {}) ⇒ Object



32
33
34
# File 'lib/nextstop.rb', line 32

def search_places(options={})
  search options.merge({:result_type => 'places'})
end