Class: Foursquared::Response::Event
- Inherits:
-
Object
- Object
- Foursquared::Response::Event
- Defined in:
- lib/foursquared/response/event.rb
Overview
Event response
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#all_day? ⇒ Boolean
Whether the event happens throughout the day.
-
#categories ⇒ Array<Foursquared::Response::Category>
The categories that have been applied to this event.
-
#date ⇒ Time
The date at which the event is happening.
-
#end_at ⇒ Time
The time at which the event ends.
-
#foreign_ids ⇒ Hash
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.
-
#here_now ⇒ Hash
Users who are present at the event now.
-
#id ⇒ String
The ID of the event.
-
#initialize(client, response) ⇒ Event
constructor
A new instance of Event.
-
#name ⇒ String
The name of the event.
-
#start_at ⇒ Time
The time at which the event starts.
-
#stats ⇒ String
The stats for the event.
-
#time_zone ⇒ String
The time zone for the event.
-
#unlock_message ⇒ String
The unlock message for the checkin at the event.
-
#url ⇒ String
The website for the event.
-
#venue_id ⇒ String
The ID of the venue of the event.
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
#client ⇒ Object (readonly)
Returns the value of attribute client.
5 6 7 |
# File 'lib/foursquared/response/event.rb', line 5 def client @client end |
#response ⇒ Object (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
59 60 61 |
# File 'lib/foursquared/response/event.rb', line 59 def all_day? response["allDay"] end |
#categories ⇒ Array<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 |
#date ⇒ Time
The date at which the event is happening
89 90 91 |
# File 'lib/foursquared/response/event.rb', line 89 def date Time.at response["date"] if response["date"] end |
#end_at ⇒ Time
The time at which the event ends
83 84 85 |
# File 'lib/foursquared/response/event.rb', line 83 def end_at Time.at response["endAt"] if response["endAt"] end |
#foreign_ids ⇒ Hash
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.
45 46 47 |
# File 'lib/foursquared/response/event.rb', line 45 def foreign_ids response["foreignIds"] end |
#here_now ⇒ Hash
Users who are present at the event now
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 |
#id ⇒ String
The ID of the event
15 16 17 |
# File 'lib/foursquared/response/event.rb', line 15 def id response["id"] end |
#name ⇒ String
The name of the event
21 22 23 |
# File 'lib/foursquared/response/event.rb', line 21 def name response["name"] end |
#start_at ⇒ Time
The time at which the event starts
77 78 79 |
# File 'lib/foursquared/response/event.rb', line 77 def start_at Time.at response["startAt"] if response["startAt"] end |
#stats ⇒ String
The stats for the event
33 34 35 |
# File 'lib/foursquared/response/event.rb', line 33 def stats response["stats"] end |
#time_zone ⇒ String
The time zone for the event
65 66 67 |
# File 'lib/foursquared/response/event.rb', line 65 def time_zone response["timeZone"] end |
#unlock_message ⇒ String
The unlock message for the checkin at the event
71 72 73 |
# File 'lib/foursquared/response/event.rb', line 71 def response["unlockMessage"] end |
#url ⇒ String
The website for the event
27 28 29 |
# File 'lib/foursquared/response/event.rb', line 27 def url response["url"] end |
#venue_id ⇒ String
The ID of the venue of the event
39 40 41 |
# File 'lib/foursquared/response/event.rb', line 39 def venue_id response["venueId"] end |