Class: Picasa::User

Inherits:
Object
  • Object
show all
Defined in:
lib/picasa/user.rb

Instance Method Summary collapse

Constructor Details

#initialize(google_user) ⇒ User

Returns a new instance of User.

Raises:

  • (ArgumentError)


3
4
5
6
# File 'lib/picasa/user.rb', line 3

def initialize(google_user)
  raise ArgumentError.new("You must specify a google user") unless google_user
  @google_user = google_user
end

Instance Method Details

#albumsObject



8
9
10
# File 'lib/picasa/user.rb', line 8

def albums
  @albums ||= Picasa::Album.all(@google_user)
end

#photos(options = {}) ⇒ Object

Raises:

  • (ArgumentError)


12
13
14
15
# File 'lib/picasa/user.rb', line 12

def photos(options = {})
  raise ArgumentError.new("You must specify album_id") unless options[:album_id]
  Picasa::Photo.find_all_by_album_id(@google_user, options[:album_id])
end

#photos_by_tags(tags) ⇒ Object



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

def photos_by_tags(tags)
  Picasa::Photo.find_all_by_tags(@google_user, tags)
end