Class: FlickrawObjects::Person

Inherits:
Object
  • Object
show all
Includes:
Attributes
Defined in:
lib/flickraw_objects.rb

Constant Summary

Constants included from Attributes

Attributes::COERCIONS

Instance Attribute Summary

Attributes included from Attributes

#init

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Attributes

included, #initialize

Class Method Details

.find_by_username(username) ⇒ Object



11
12
13
14
# File 'lib/flickraw_objects.rb', line 11

def self.find_by_username(username)
  response = flickr.people.findByUsername username: username
  Person.new(response)
end

Instance Method Details

#get_infoObject



36
37
38
# File 'lib/flickraw_objects.rb', line 36

def get_info
  @get_info ||= flickr.people.getInfo user_id: id
end

#get_photos(params = {}) ⇒ Object Also known as: photos



16
17
18
19
20
21
22
23
# File 'lib/flickraw_objects.rb', line 16

def get_photos(params = {})
  result = Array.new
  response = flickr.people.getPhotos user_id: id
  response.each do |photo|
    result << Photo.new(photo)
  end
  result
end

#get_photosets(params = {}) ⇒ Object Also known as: photosets



26
27
28
29
30
31
32
33
# File 'lib/flickraw_objects.rb', line 26

def get_photosets(params = {})
  result = Array.new
  response = flickr.photosets.getList user_id: id
  response.each do |photoset|
    result << Photoset.new(photoset)
  end
  result
end