Class: NVX::SDS::ItemBase
- Inherits:
-
Object
- Object
- NVX::SDS::ItemBase
- 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.
Instance Method Summary collapse
-
#created_date ⇒ Object
The date the file was created on the Nirvanix system.
-
#HostItem ⇒ Object
A method that hosts this file / folder making it available publicly.
-
#initialize(account_login, fs_item_attributes) ⇒ ItemBase
constructor
Creates the object based on the file/folder attributes object.
-
#name ⇒ Object
The name of the file/folder.
-
#path ⇒ Object
The relative path to the file/folder.
-
#RemoveHostedItem ⇒ Object
Removes the file / folder from the list of hosted items (Does not destroy the file.).
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(account_login, fs_item_attributes) if !fs_item_attributes.nil? @account_login, @created_date = account_login, fs_item_attributes.created_date @name, @path = fs_item_attributes.name, fs_item_attributes.path end end |
Instance Method Details
#created_date ⇒ Object
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 |
#HostItem ⇒ Object
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)], @account_login) end |
#name ⇒ Object
The name of the file/folder.
33 34 35 |
# File 'lib/nvx/sds/itembase.rb', line 33 def name @name end |
#path ⇒ Object
The relative path to the file/folder.
38 39 40 |
# File 'lib/nvx/sds/itembase.rb', line 38 def path @path end |
#RemoveHostedItem ⇒ Object
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)], @account_login) end |