Class: Smile::Smug
Constant Summary
Constant Summary
Constants included from Common
Common::BASE, Common::BASE_SECURE, Common::UPLOAD, Common::VERSION
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary (collapse)
-
- (Array<Smile::Album>) albums(options = nil)
Retrieves a list of albums for a given user.
-
- (Smile::SmugMug.new) auth(email, pass)
Login to SmugMug using a specific user account.
-
- (Smile::SmugMug.new) auth_anonymously
Login to SmugMug using an anonymously account This will allow you to execute many functions, but no user specific functions.
-
- (Object) logout
Close the session.
Methods inherited from Base
clear_config!, configure, #initialize, #method_missing
Methods included from Common
#base_web_method_call, #default_params, #logger, #logger_on?, #secure_web_method_call, #session, #upper_hash_to_lower_hash, #web_method_call
Constructor Details
This class inherits a constructor from Smile::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Smile::Base
Instance Method Details
- (Array<Smile::Album>) albums(options = nil)
Retrieves a list of albums for a given user. If you are logged in it will return your albums.
information is returned about the album password here to access private information.
59 60 61 62 63 64 65 66 |
# File 'lib/smile/smug.rb', line 59 def albums( =nil ) json = web_method_call( { :method => 'smugmug.albums.get', :heavy => 1 }, ) Smile::Album.from_json( json ) end |
- (Smile::SmugMug.new) auth(email, pass)
Login to SmugMug using a specific user account.
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/smile/smug.rb', line 16 def auth( email, pass ) json = secure_web_method_call( { :method => 'smugmug.login.withPassword', :EmailAddress => email, :Password => pass } ) self.session.id = json["login"]["session"]["id"] json end |
- (Smile::SmugMug.new) auth_anonymously
Login to SmugMug using an anonymously account This will allow you to execute many functions, but no user specific functions
32 33 34 35 36 37 |
# File 'lib/smile/smug.rb', line 32 def auth_anonymously json = secure_web_method_call( { :method => 'smugmug.login.anonymously' } ) self.session.id = json["login"]["session"]["id"] json end |
- (Object) logout
Close the session
40 41 42 |
# File 'lib/smile/smug.rb', line 40 def logout web_method_call( { :method => 'smugmug.logout' } ) end |