Class: Skydrive::Folder

Inherits:
Object
  • Object
show all
Defined in:
lib/skydrive/folder.rb

Overview

The folder object

Direct Known Subclasses

Album

Instance Attribute Summary

Attributes inherited from Object

#client, #object

Instance Method Summary collapse

Methods inherited from Object

#comment, #comments, #created_time, #description, #from, #id, #initialize, #is_embeddable?, #link, #name, #parent_id, #shared_with, #to_hash, #to_json, #type, #updated_time, #upload_location

Constructor Details

This class inherits a constructor from Skydrive::Object

Instance Method Details

#deleteObject

Delete the folder



39
40
41
# File 'lib/skydrive/folder.rb', line 39

def delete
  client.delete("/#{id}")
end

#files(options = {}) ⇒ Skydrive::Collection

Items in the folder

Parameters:

  • options (Hash) (defaults to: {})

    Additional parameters

Options Hash (options):

  • :limit (Integer)

    the maximum number of results to return

  • :offset (Integer)

    the index of the first item to get

  • :sort_by (String)

    set the item’s sort criteria. Can be ‘created, updated, name, size, or default’

  • :sort_order (String)

    set the item’s sort order. Can be ‘ascending or descending’

Returns:



12
13
14
# File 'lib/skydrive/folder.rb', line 12

def files options={}
  response = client.get("/#{id}/files")
end

#photos(options = {}) ⇒ Skydrive::Collection

Get all the photos in the folder

Parameters:

  • options (Hash) (defaults to: {})

    Additional parameters

Options Hash (options):

  • :limit (Integer)

    the maximum number of results to return

  • :offset (Integer)

    the index of the first item to get

  • :sort_by (String)

    set the item’s sort criteria. Can be ‘created, updated, name, size, or default’

  • :sort_order (String)

    set the item’s sort order. Can be ‘ascending or descending’

Returns:



23
24
25
# File 'lib/skydrive/folder.rb', line 23

def photos options={}
  response = client.get("/#{id}/photos", options)
end

#update(options = {}) ⇒ Skydrive::Folder

Update the folder properties

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :name (String)

    New name of the folder

  • :description (String)

    Description for the folder

Returns:



48
49
50
# File 'lib/skydrive/folder.rb', line 48

def update options={}
  client.put("/#{id}", options)
end

#videos(options = {}) ⇒ Skydrive::Collection

Get all the videos in the folder

Parameters:

  • options (Hash) (defaults to: {})

    Additional parameters

Options Hash (options):

  • :limit (Integer)

    the maximum number of results to return

  • :offset (Integer)

    the index of the first item to get

  • :sort_by (String)

    set the item’s sort criteria. Can be ‘created, updated, name, size, or default’

  • :sort_order (String)

    set the item’s sort order. Can be ‘ascending or descending’

Returns:



34
35
36
# File 'lib/skydrive/folder.rb', line 34

def videos options={}
  response = client.get("/#{id}/videos", options)
end