Class: GDocsAPIWrapper::Client
- Inherits:
-
Object
- Object
- GDocsAPIWrapper::Client
- Defined in:
- lib/gdocsapi-wrapper/client.rb
Instance Attribute Summary collapse
-
#login_handler ⇒ Object
Returns the value of attribute login_handler.
-
#source ⇒ Object
Identifying the application which uses the GDocsAPIWrapper.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
-
#login(username, password) ⇒ Object
Performs login on GDocsAPIWrapper:Auth.
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
29 30 31 32 33 34 35 |
# File 'lib/gdocsapi-wrapper/client.rb', line 29 def initialize( = {}) .each do |key, value| self.send("#{key}=", value) end @source ||= 'UndefinedApplication' end |
Instance Attribute Details
#login_handler ⇒ Object
Returns the value of attribute login_handler.
27 28 29 |
# File 'lib/gdocsapi-wrapper/client.rb', line 27 def login_handler @login_handler end |
#source ⇒ Object
Identifying the application which uses the GDocsAPIWrapper
26 27 28 |
# File 'lib/gdocsapi-wrapper/client.rb', line 26 def source @source end |
Instance Method Details
#login(username, password) ⇒ Object
Performs login on GDocsAPIWrapper:Auth
38 39 40 41 42 43 44 45 |
# File 'lib/gdocsapi-wrapper/client.rb', line 38 def login(username, password) source = GDocsAPIWrapper::Auth::SOURCE_PREFIX + @source @login_handler = GDocsAPIWrapper::Auth::Login.new @login_handler.perform_login(username, password, source) puts 'Token: ' + @login_handler.token end |