Class: Picasa::Client
- Inherits:
-
Object
- Object
- Picasa::Client
- Defined in:
- lib/picasa/client.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#authorization_header ⇒ Object
Returns the value of attribute authorization_header.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
Instance Method Summary collapse
- #album ⇒ API::Album
- #comment ⇒ API::Comment
-
#initialize(credentials = {}) ⇒ Client
constructor
A new instance of Client.
- #photo ⇒ API::Photo
- #tag ⇒ API::Tag
Constructor Details
#initialize(credentials = {}) ⇒ Client
Returns a new instance of Client.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/picasa/client.rb', line 10 def initialize(credentials = {}) if credentials[:password] raise(ArgumentError, "Providing password has no effect as google login by password API is not active anymore https://developers.google.com/accounts/docs/AuthForInstalledApps") end @user_id = credentials[:user_id] || raise(ArgumentError, "You must specify user_id") @access_token = credentials[:access_token] if credentials[:authorization_header] puts "Passing authorization_header is deprecated. Please pass access_token" end @authorization_header = credentials[:authorization_header] end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
4 5 6 |
# File 'lib/picasa/client.rb', line 4 def access_token @access_token end |
#authorization_header ⇒ Object
Returns the value of attribute authorization_header.
4 5 6 |
# File 'lib/picasa/client.rb', line 4 def @authorization_header end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
3 4 5 |
# File 'lib/picasa/client.rb', line 3 def user_id @user_id end |
Instance Method Details
#album ⇒ API::Album
29 30 31 |
# File 'lib/picasa/client.rb', line 29 def album API::Album.new(credentials) end |
#comment ⇒ API::Comment
62 63 64 |
# File 'lib/picasa/client.rb', line 62 def comment API::Comment.new(credentials) end |
#photo ⇒ API::Photo
40 41 42 |
# File 'lib/picasa/client.rb', line 40 def photo API::Photo.new(credentials) end |