Class: NVX::SDS::ItemBase

Inherits:
Object
  • Object
show all
Defined in:
lib/nvx/sds/itembase.rb

Overview

Overview

Base object for both files and folders. This object stores both the base attributes and allows setting if the item is hosted or not.

Direct Known Subclasses

Folder, NVXFile

Instance Method Summary collapse

Constructor Details

#initialize(account_login, fs_item_attributes) ⇒ ItemBase

Creates the object based on the file/folder attributes object.



20
21
22
23
24
25
# File 'lib/nvx/sds/itembase.rb', line 20

def initialize(, fs_item_attributes)
    if !fs_item_attributes.nil?
        , @created_date = , fs_item_attributes.created_date
        @name, @path = fs_item_attributes.name, fs_item_attributes.path
    end
end

Instance Method Details

#created_dateObject

The date the file was created on the Nirvanix system.



28
29
30
# File 'lib/nvx/sds/itembase.rb', line 28

def created_date
    @created_date
end

#HostItemObject

A method that hosts this file / folder making it available publicly.



43
44
45
# File 'lib/nvx/sds/itembase.rb', line 43

def HostItem
    Transport.execute_command_post(APICommand.CreateHostedItem, [APIParam.new("sharePath", @path)], )
end

#nameObject

The name of the file/folder.



33
34
35
# File 'lib/nvx/sds/itembase.rb', line 33

def name
    @name
end

#pathObject

The relative path to the file/folder.



38
39
40
# File 'lib/nvx/sds/itembase.rb', line 38

def path                
    @path
end

#RemoveHostedItemObject

Removes the file / folder from the list of hosted items (Does not destroy the file.)



48
49
50
# File 'lib/nvx/sds/itembase.rb', line 48

def RemoveHostedItem
    Transport.execute_command_post(APICommand.RemoveHostedItem, [APIParam.new("sharePath", @path)], )
end