Class: Foursquare::Merchant::VenueGroup

Inherits:
Model
  • Object
show all
Defined in:
lib/foursquare/venue_group.rb

Constant Summary

Constants included from Requests

Requests::API, Requests::OAUTH

Instance Attribute Summary

Attributes inherited from Model

#consumer

Instance Method Summary collapse

Methods included from Requests

#get, #post

Constructor Details

#initialize(hash, consumer) ⇒ VenueGroup

Returns a new instance of VenueGroup.



9
10
11
12
# File 'lib/foursquare/venue_group.rb', line 9

def initialize(hash, consumer)
  super
  self.venues = self.venues['items'].map { |item| Venue.new(item, @consumer) } if self.venues
end

Instance Method Details

#add_venue(venue_ids) ⇒ Object



18
19
20
21
# File 'lib/foursquare/venue_group.rb', line 18

def add_venue(venue_ids)
  params = {:venue_ids => listify(venue_ids)}
  self.post("venuegroups/#{id}/addvenue", params)
end

#deleteObject



14
15
16
# File 'lib/foursquare/venue_group.rb', line 14

def delete
  self.post("venuegroups/#{id}/delete", {})
end

#remove_venue(venue_ids) ⇒ Object



23
24
25
26
# File 'lib/foursquare/venue_group.rb', line 23

def remove_venue(venue_ids)
  params = {:venue_ids => listify(venue_ids)}
  self.post("venuegroups/#{id}/removevenue", params)
end