Class: OneDriveForBusiness::Drive

Inherits:
Object
  • Object
show all
Includes:
Util
Defined in:
lib/onedrive_for_business/drive.rb

Defined Under Namespace

Classes: Quota

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Util

#http

Constructor Details

#initialize(tenant, access_token) ⇒ Object

Returns Drive.



8
9
10
11
# File 'lib/onedrive_for_business/drive.rb', line 8

def initialize(tenant, access_token)
  @url = "https://#{tenant}-my.sharepoint.com/_api/v1.0/me/drive"
  @access_token = access_token
end

Instance Attribute Details

#access_tokenObject (readonly)

Returns the value of attribute access_token.



13
14
15
# File 'lib/onedrive_for_business/drive.rb', line 13

def access_token
  @access_token
end

#urlObject (readonly)

Returns the value of attribute url.



14
15
16
# File 'lib/onedrive_for_business/drive.rb', line 14

def url
  @url
end

Instance Method Details

#idObject

Returns String.

Returns:

  • String



17
18
19
20
# File 'lib/onedrive_for_business/drive.rb', line 17

def id
  fetch_properties! unless @id
  @id
end

#ownerObject

Returns Identity.

Returns:

  • Identity



23
24
25
26
# File 'lib/onedrive_for_business/drive.rb', line 23

def owner
  fetch_properties! unless @owner
  @owner
end

#quotaObject

Returns Drive::Quota.

Returns:

  • Drive::Quota



29
30
31
32
# File 'lib/onedrive_for_business/drive.rb', line 29

def quota
  fetch_properties! unless @quota
  @quota
end