Class: Foursquared::Response::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/foursquared/response/event.rb

Overview

Event response

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, response) ⇒ Event

Returns a new instance of Event.



7
8
9
10
# File 'lib/foursquared/response/event.rb', line 7

def initialize client, response
  @client  = client
  @response = response
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



5
6
7
# File 'lib/foursquared/response/event.rb', line 5

def client
  @client
end

#responseObject (readonly)

Returns the value of attribute response.



5
6
7
# File 'lib/foursquared/response/event.rb', line 5

def response
  @response
end

Instance Method Details

#all_day?Boolean

Whether the event happens throughout the day

Returns:

  • (Boolean)


59
60
61
# File 'lib/foursquared/response/event.rb', line 59

def all_day?
  response["allDay"]
end

#categoriesArray<Foursquared::Response::Category>

The categories that have been applied to this event



51
52
53
54
55
# File 'lib/foursquared/response/event.rb', line 51

def categories
  @categories = response["categories"]
  @categories.map!{|category| Foursquared::Response::Category.new(client, category)} if @categories
  @categories
end

#dateTime

The date at which the event is happening

Returns:

  • (Time)


89
90
91
# File 'lib/foursquared/response/event.rb', line 89

def date
  Time.at response["date"] if response["date"]
end

#end_atTime

The time at which the event ends

Returns:

  • (Time)


83
84
85
# File 'lib/foursquared/response/event.rb', line 83

def end_at
  Time.at response["endAt"] if response["endAt"]
end

#foreign_idsHash

The count of ids of this event in third-party services, plus items, an array of domain, the third party provider, and id, the id in their system.

Returns:

  • (Hash)


45
46
47
# File 'lib/foursquared/response/event.rb', line 45

def foreign_ids
  response["foreignIds"]
end

#here_nowHash

Users who are present at the event now

Returns:

  • (Hash)


95
96
97
98
99
100
101
# File 'lib/foursquared/response/event.rb', line 95

def here_now
  @here_now = response["hereNow"]
  @here_now["groups"].each do |group| 
    group["items"].map!{|user| Foursquared::Response::User.new(client, user)}
  end
  @here_now
end

#idString

The ID of the event

Returns:

  • (String)


15
16
17
# File 'lib/foursquared/response/event.rb', line 15

def id
  response["id"]
end

#nameString

The name of the event

Returns:

  • (String)


21
22
23
# File 'lib/foursquared/response/event.rb', line 21

def name
  response["name"]
end

#start_atTime

The time at which the event starts

Returns:

  • (Time)


77
78
79
# File 'lib/foursquared/response/event.rb', line 77

def start_at
  Time.at response["startAt"] if response["startAt"]
end

#statsString

The stats for the event

Returns:

  • (String)


33
34
35
# File 'lib/foursquared/response/event.rb', line 33

def stats
  response["stats"]
end

#time_zoneString

The time zone for the event

Returns:

  • (String)


65
66
67
# File 'lib/foursquared/response/event.rb', line 65

def time_zone
  response["timeZone"]
end

#unlock_messageString

The unlock message for the checkin at the event

Returns:

  • (String)


71
72
73
# File 'lib/foursquared/response/event.rb', line 71

def unlock_message
  response["unlockMessage"]
end

#urlString

The website for the event

Returns:

  • (String)


27
28
29
# File 'lib/foursquared/response/event.rb', line 27

def url
  response["url"]
end

#venue_idString

The ID of the venue of the event

Returns:

  • (String)


39
40
41
# File 'lib/foursquared/response/event.rb', line 39

def venue_id
  response["venueId"]
end