Class: Fotolia::Galleries
- Inherits:
-
Object
- Object
- Fotolia::Galleries
- Defined in:
- lib/fotolia/galleries.rb
Overview
Interface to galleries at Fotolia.
Use Fotolia::Base#galleries as shortcut to an instance of this class.
Instance Method Summary collapse
-
#create(name) ⇒ Object
Creates a gallery for the logged in user.
-
#find_all ⇒ Object
Returns public galleries in an array (of Fotolia::Gallery objects).
-
#initialize(fotolia_client) ⇒ Galleries
constructor
A new instance of Galleries.
Constructor Details
#initialize(fotolia_client) ⇒ Galleries
Returns a new instance of Galleries.
8 9 10 |
# File 'lib/fotolia/galleries.rb', line 8 def initialize(fotolia_client) @fotolia = fotolia_client end |
Instance Method Details
#create(name) ⇒ Object
Creates a gallery for the logged in user.
Requires an authenticated session, see Fotolia::Base#login.
Not working with Partner API.
28 29 30 31 32 33 34 |
# File 'lib/fotolia/galleries.rb', line 28 def create(name) raise Fotolia::LoginRequiredError unless @fotolia.logged_in? res = @fotolia.remote_call('createUserGallery', @fotolia.session_id, name) Fotolia::Gallery.new(@fotolia, {'id' => res['id'], 'name' => name}) end |