Class: NVX::SDS::FSFolderAttributes

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

Overview

FSFolderAttributes is an internal class used to extract folder information from a ListFolders call.

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ FSFolderAttributes

Extract the folder information from the xml fragment.



9
10
11
12
13
14
15
16
17
18
# File 'lib/nvx/sds/APIClasses/fsfolderattributes.rb', line 9

def initialize(xml)
    if !xml.nil?
        doc = REXML::Document.new(xml)
        @name = (text = doc.root.elements["//Folder/Name"].get_text and text.value)
        @path = (text = doc.root.elements["//Folder/Path"].get_text and text.value)
        @created_date = (text = doc.root.elements["//Folder/CreatedDate"].get_text and text.value)
        @folder_count = (text = doc.root.elements["//Folder/FolderCount"].get_text and text.value)
        @file_count = (text = doc.root.elements["//Folder/FileCount"].get_text and text.value)
    end
end

Instance Method Details

#created_dateObject

The date created.



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

def created_date
    @created_date.nil? ? "" : @created_date
end

#EmptyRootFolder(name, path, created_date) ⇒ Object

Creates the Base root folder, used internally for ListFolders call.



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

def EmptyRootFolder(name, path, created_date)
    @name = name
    @path = path
    @created_date = created_date
end

#file_countObject

the children file count



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

def file_count
    @file_count
end

#folder_countObject

The children folder count.



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

def folder_count
    @folder_count
end

#nameObject

The name of the folder



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

def name
    @name
end

#pathObject

The path to the folder.



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

def path
    @path
end