Class: Gowalla::Top10

Inherits:
Object
  • Object
show all
Defined in:
lib/gowalla/top_10.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ Top10

Returns a new instance of Top10.



5
6
7
8
9
10
11
# File 'lib/gowalla/top_10.rb', line 5

def initialize(data={})
  @checkins_count = data['checkins_count']
  @first_name = data['first_name']
  @last_name = data['last_name']
  @url = data['url']
  @image_url = data['image_url']
end

Instance Attribute Details

#checkins_countObject

Returns the value of attribute checkins_count.



3
4
5
# File 'lib/gowalla/top_10.rb', line 3

def checkins_count
  @checkins_count
end

#first_nameObject

Returns the value of attribute first_name.



3
4
5
# File 'lib/gowalla/top_10.rb', line 3

def first_name
  @first_name
end

#image_urlObject

Returns the value of attribute image_url.



3
4
5
# File 'lib/gowalla/top_10.rb', line 3

def image_url
  @image_url
end

#last_nameObject

Returns the value of attribute last_name.



3
4
5
# File 'lib/gowalla/top_10.rb', line 3

def last_name
  @last_name
end

#urlObject

Returns the value of attribute url.



3
4
5
# File 'lib/gowalla/top_10.rb', line 3

def url
  @url
end

Instance Method Details

#userObject



13
14
15
# File 'lib/gowalla/top_10.rb', line 13

def user
  User.find(self.url.split("/users/").last) # grab the user id
end