Class: Mosaic::Foursquare::Checkin

Inherits:
Object
  • Object
show all
Defined in:
lib/mosaic/foursquare/checkin.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Object

query, request_count, request_count=

Methods included from Utils::Helpers

#underscore_string

Constructor Details

#initialize(attributes = {}) ⇒ Checkin

Returns a new instance of Checkin.



15
16
17
18
19
20
# File 'lib/mosaic/foursquare/checkin.rb', line 15

def initialize(attributes = {})
  super
  self.photos &&= self.photos['items'].collect { |item| Mosaic::Foursquare::Photo.new(item) }
  self.user &&= Mosaic::Foursquare::User.new(self.user)
  self.venue &&= Mosaic::Foursquare::Venue.new(self.venue)
end

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



6
7
8
# File 'lib/mosaic/foursquare/checkin.rb', line 6

def created_at
  @created_at
end

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/mosaic/foursquare/checkin.rb', line 6

def id
  @id
end

#photosObject

Returns the value of attribute photos.



6
7
8
# File 'lib/mosaic/foursquare/checkin.rb', line 6

def photos
  @photos
end

#shoutObject

Returns the value of attribute shout.



6
7
8
# File 'lib/mosaic/foursquare/checkin.rb', line 6

def shout
  @shout
end

#userObject

Returns the value of attribute user.



6
7
8
# File 'lib/mosaic/foursquare/checkin.rb', line 6

def user
  @user
end

#venueObject

Returns the value of attribute venue.



6
7
8
# File 'lib/mosaic/foursquare/checkin.rb', line 6

def venue
  @venue
end

Class Method Details

.find(id, options = {}) ⇒ Object



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

def find(id, options = {})
  response = query("/checkins/#{id}", options)
  self.new response['response']['checkin']
end