Class: Dropbox::WebClient::Session

Inherits:
Object
  • Object
show all
Includes:
Actions, Authentication, Paths
Defined in:
lib/dropbox/web_client/session.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Actions

#invite, #share_options

Methods included from Authentication

#authenticate, #authenticated?, #ensure_authenticated

Constructor Details

#initialize(credentials = {}) ⇒ Session

Returns a new instance of Session.



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/dropbox/web_client/session.rb', line 12

def initialize(credentials = {})
  # Initialize login details
  @email = credentials[:email]
  @password = credentials[:password]

  # Initialize cookie manager
  @cookies = CookieManager.new
  
  # Start unauthenticated
  @authenticated = false
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Dropbox::WebClient::Paths

Instance Attribute Details

#cookiesObject (readonly)

Returns the value of attribute cookies.



10
11
12
# File 'lib/dropbox/web_client/session.rb', line 10

def cookies
  @cookies
end

#emailObject

Returns the value of attribute email.



9
10
11
# File 'lib/dropbox/web_client/session.rb', line 9

def email
  @email
end

#passwordObject

Returns the value of attribute password.



9
10
11
# File 'lib/dropbox/web_client/session.rb', line 9

def password
  @password
end