Class: Spacer::User

Inherits:
Object
  • Object
show all
Includes:
Model
Defined in:
lib/spacer/models/user.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Model

included, #initialize, #populate, #populate_from_hash!, #populated?

Instance Attribute Details

#__typeObject

Returns the value of attribute __type.



4
5
6
# File 'lib/spacer/models/user.rb', line 4

def __type
  @__type
end

#clientObject

Returns the value of attribute client.



5
6
7
# File 'lib/spacer/models/user.rb', line 5

def client
  @client
end

#imageObject

Returns the value of attribute image.



4
5
6
# File 'lib/spacer/models/user.rb', line 4

def image
  @image
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/spacer/models/user.rb', line 4

def name
  @name
end

#onlineNowObject

Returns the value of attribute onlineNow.



4
5
6
# File 'lib/spacer/models/user.rb', line 4

def onlineNow
  @onlineNow
end

#uriObject

Returns the value of attribute uri.



4
5
6
# File 'lib/spacer/models/user.rb', line 4

def uri
  @uri
end

#userIdObject

Returns the value of attribute userId.



4
5
6
# File 'lib/spacer/models/user.rb', line 4

def userId
  @userId
end

#userTypeObject

Returns the value of attribute userType.



4
5
6
# File 'lib/spacer/models/user.rb', line 4

def userType
  @userType
end

#webUriObject

Returns the value of attribute webUri.



4
5
6
# File 'lib/spacer/models/user.rb', line 4

def webUri
  @webUri
end

Class Method Details

.from_hash_with_client(hash, client) ⇒ Object



8
9
10
11
12
# File 'lib/spacer/models/user.rb', line 8

def from_hash_with_client(hash, client)
  instance = new(hash)
  instance.client = client
  instance        
end

Instance Method Details

#album(album_id) ⇒ Object



29
30
31
# File 'lib/spacer/models/user.rb', line 29

def album(album_id)
  @client.album(userId, album_id)
end

#albumsObject



25
26
27
# File 'lib/spacer/models/user.rb', line 25

def albums
  @client.albums(userId)
end

#detailsObject



45
46
47
# File 'lib/spacer/models/user.rb', line 45

def details
  @client.details(userId)
end

#friends(page = nil, page_size = nil, list = nil) ⇒ Object



21
22
23
# File 'lib/spacer/models/user.rb', line 21

def friends(page=nil, page_size=nil, list=nil)
  @client.friends(userId, page, page_size, list)
end

#friends_with?(friends_ids) ⇒ Boolean

Returns:

  • (Boolean)


69
70
71
# File 'lib/spacer/models/user.rb', line 69

def friends_with?(friends_ids)
  @client.friendship?(userId, friend_ids)
end

#groupsObject



73
74
75
# File 'lib/spacer/models/user.rb', line 73

def groups
  @client.groups(userId)
end

#interestsObject



41
42
43
# File 'lib/spacer/models/user.rb', line 41

def interests
  @client.interests(userId)
end

#moodObject



65
66
67
# File 'lib/spacer/models/user.rb', line 65

def mood
  @client.mood(userId)
end

#photo(photo_id) ⇒ Object



57
58
59
# File 'lib/spacer/models/user.rb', line 57

def photo(photo_id)
  @client.photo(userId, photo_id)
end

#photosObject



37
38
39
# File 'lib/spacer/models/user.rb', line 37

def photos
  @client.photos(userId)
end

#photos_for_album(album_id) ⇒ Object



33
34
35
# File 'lib/spacer/models/user.rb', line 33

def photos_for_album(album_id)
  @client.photos_for_album(userId, album_id)
end

#profileObject

These are helper methods to access client calls if you already have a user instance



17
18
19
# File 'lib/spacer/models/user.rb', line 17

def profile
  @client.profile(userId)
end

#statusObject



61
62
63
# File 'lib/spacer/models/user.rb', line 61

def status
  @client.status(userId)
end

#video(video_id) ⇒ Object



53
54
55
# File 'lib/spacer/models/user.rb', line 53

def video(video_id)
  @client.video(userId, video_id)
end

#videosObject



49
50
51
# File 'lib/spacer/models/user.rb', line 49

def videos
  @client.videos(userId)
end