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.



21
22
23
24
25
26
# File 'lib/foursquare2/venuegroups.rb', line 21

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) ⇒ Object

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



54
55
56
57
58
59
# File 'lib/foursquare2/venuegroups.rb', line 54

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

#list_venuegroupObject

List all venue groups owned by the user.



44
45
46
47
48
49
# File 'lib/foursquare2/venuegroups.rb', line 44

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

#venuegroup(group_id) ⇒ Object

Retrieve information about a venuegroup

param [String] group_id The ID of the venuegroup



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

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

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



35
36
37
38
39
40
# File 'lib/foursquare2/venuegroups.rb', line 35

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