Module: Foursquare2::Venuegroups

Included in:
Client
Defined in:
lib/foursquare2/venuegroups.rb

Instance Method Summary collapse

Instance Method Details

#add_venuegroup(options = {}) ⇒ Object

Create a venue group. If the venueId parameter is specified, then the endpoint will add the specified venues to the venue group. If it is not possible to add all of the specified venues to the group, then creation of the venue group will fail entirely.

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • String (Object)

    :name - Required. The name to give the group.

  • String (Object)

    :venueId - Comma-delimited list of venue IDs to add to the group. If this parameter is not specified, then the venue group will initially be empty.



23
24
25
26
27
28
# File 'lib/foursquare2/venuegroups.rb', line 23

def add_venuegroup(options={})
  response = connection.post do |req|
    req.url "venuegroups/add", options
  end
  return_error_or_body(response, response.body.response.venueGroup)
end

#delete_venuegroup(group_id, options = {}) ⇒ Object

Delete a venue group. param [String] group_id - The ID of the venuegroup to delete.



56
57
58
59
60
61
# File 'lib/foursquare2/venuegroups.rb', line 56

def delete_venuegroup(group_id, options={})
  response = connection.post do |req|
    req.url "venuegroups/#{group_id}/delete", options
  end
  return_error_or_body(response, response.body.response)
end

#list_venuegroup(options = {}) ⇒ Object

List all venue groups owned by the user.



46
47
48
49
50
51
# File 'lib/foursquare2/venuegroups.rb', line 46

def list_venuegroup(options={})
  response = connection.get do |req|
    req.url "venuegroups/list", options
  end
  return_error_or_body(response, response.body.response.venueGroups)
end

#venuegroup(group_id, options = {}) ⇒ Object

Retrieve information about a venuegroup

param [String] group_id The ID of the venuegroup



8
9
10
11
12
13
# File 'lib/foursquare2/venuegroups.rb', line 8

def venuegroup(group_id, options={})
  response = connection.get do |req|
    req.url "venuegroups/#{group_id}", options
  end
  return_error_or_body(response, response.body.response.venueGroup)
end

#venuegroup_update(group_id, options = {}) ⇒ Object



37
38
39
40
41
42
# File 'lib/foursquare2/venuegroups.rb', line 37

def venuegroup_update(group_id, options={})
  response = connection.post do |req|
    req.url "venuegroups/#{group_id}/update", options
  end
  return_error_or_body(response, response.body.response.venueGroup)
end