Class: GDocsAPIWrapper::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/gdocsapi-wrapper/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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(options = {})
  options.each do |key, value|
    self.send("#{key}=", value)
  end
  
  @source ||= 'UndefinedApplication'
end

Instance Attribute Details

#login_handlerObject

Returns the value of attribute login_handler.



27
28
29
# File 'lib/gdocsapi-wrapper/client.rb', line 27

def 
  @login_handler
end

#sourceObject

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 (username, password)
  source = GDocsAPIWrapper::Auth::SOURCE_PREFIX + @source
  
  @login_handler = GDocsAPIWrapper::Auth::.new
  @login_handler.(username, password, source)
  
  puts 'Token: ' + @login_handler.token
end