Class: Manhunt::Photo

Inherits:
Object
  • Object
show all
Defined in:
lib/manhunt/photo.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user, photo_id) ⇒ Photo

Returns a new instance of Photo.



4
5
6
7
# File 'lib/manhunt/photo.rb', line 4

def initialize(user, photo_id)
  @user = user
  @photo_id = photo_id
end

Instance Attribute Details

#photo_idObject (readonly)

Returns the value of attribute photo_id.



2
3
4
# File 'lib/manhunt/photo.rb', line 2

def photo_id
  @photo_id
end

Class Method Details

.content(session, profile_id, photo_id, size = "med") ⇒ Object



13
14
15
16
17
# File 'lib/manhunt/photo.rb', line 13

def self.content(session, profile_id, photo_id, size = "med")
  photo_ref = session.post_object('/photo/ajaxGetPhoto', {'profileId' => profile_id, 'photoId' => photo_id, 'photoSize' => size })

  session.get_binary(photo_ref['url'])
end

Instance Method Details

#user_idObject



9
10
11
# File 'lib/manhunt/photo.rb', line 9

def user_id
  @user.user_id
end