Class: NVX::SDS::FSFileAttributes

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

Overview

Used to extract file information from a ListFolders call.

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ FSFileAttributes

Reads the File node from the xml fragment.



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

def initialize(xml)
    doc = REXML::Document.new(xml)
    
    @name = (text = doc.root.elements["//File/Name"].get_text and text.value)
    @path = (text = doc.root.elements["//File/Path"].get_text and text.value)
    @created_date = (text = doc.root.elements["//File/CreatedDate"].get_text and text.value)
    @size_bytes = (text = doc.root.elements["//File/SizeBytes"].get_text and text.value)                
    @metadata = (text = doc.root.elements["//File/Metadata"].get_text and text.value)
    @file_tags = (text = doc.root.elements["//File/FileTags"].get_text and text.value)
end

Instance Method Details

#created_dateObject

The date the file was created on the local system.



30
31
32
# File 'lib/nvx/sds/APIClasses/fsfileattributes.rb', line 30

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

#file_tagsObject

The array of tags.



45
46
47
# File 'lib/nvx/sds/APIClasses/fsfileattributes.rb', line 45

def file_tags
    @fileTags
end

#metadataObject

The metadata for the file.



40
41
42
# File 'lib/nvx/sds/APIClasses/fsfileattributes.rb', line 40

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

#nameObject

The filename.



20
21
22
# File 'lib/nvx/sds/APIClasses/fsfileattributes.rb', line 20

def name
    @name
end

#pathObject

The full relative path to the file.



25
26
27
# File 'lib/nvx/sds/APIClasses/fsfileattributes.rb', line 25

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

#size_bytesObject

The size of the file.



35
36
37
# File 'lib/nvx/sds/APIClasses/fsfileattributes.rb', line 35

def size_bytes
    @size_bytes
end