Class: Gobbler::Folder

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

Instance Attribute Summary

Attributes inherited from Base

#json

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#base_attr, get, #initialize

Constructor Details

This class inherits a constructor from Gobbler::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Gobbler::Base

Class Method Details

.list(opts = {}) ⇒ Array<Folder>

Returns An array of Folders.

Returns:

  • (Array<Folder>)

    An array of Folders



15
16
17
18
# File 'lib/gobbler/folder.rb', line 15

def self.list(opts = {})
  opts[:offset] ||= 0
  ::Gobbler.request("client_catalog/sync_ask_folder", options: opts)["updates"].map {|folder| new(folder)}
end

Instance Method Details

#assetsHash

Returns The assets for this folder.

Returns:

  • (Hash)

    The assets for this folder



31
32
33
# File 'lib/gobbler/folder.rb', line 31

def assets
  ::Gobbler.unpack json["dir"]["assets_packed"]
end

#guidString

Returns The guid for the folder.

Returns:

  • (String)

    The guid for the folder



21
22
23
# File 'lib/gobbler/folder.rb', line 21

def guid
  user_data_guid
end

#volumeVolume

Returns The volume that this folder is on.

Returns:

  • (Volume)

    The volume that this folder is on



26
27
28
# File 'lib/gobbler/folder.rb', line 26

def volume
  ::Gobbler::Volume.get(volume_guid)
end