Class: NVX::SDS::FSFileAttributes
- Inherits:
-
Object
- Object
- NVX::SDS::FSFileAttributes
- Defined in:
- lib/nvx/sds/APIClasses/fsfileattributes.rb
Overview
Used to extract file information from a ListFolders call.
Instance Method Summary collapse
-
#created_date ⇒ Object
The date the file was created on the local system.
-
#file_tags ⇒ Object
The array of tags.
-
#initialize(xml) ⇒ FSFileAttributes
constructor
Reads the File node from the xml fragment.
-
#metadata ⇒ Object
The metadata for the file.
-
#name ⇒ Object
The filename.
-
#path ⇒ Object
The full relative path to the file.
-
#size_bytes ⇒ Object
The size of the file.
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_date ⇒ Object
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_tags ⇒ Object
The array of tags.
45 46 47 |
# File 'lib/nvx/sds/APIClasses/fsfileattributes.rb', line 45 def @fileTags end |
#metadata ⇒ Object
The metadata for the file.
40 41 42 |
# File 'lib/nvx/sds/APIClasses/fsfileattributes.rb', line 40 def @metadata.nil? ? "" : @metadata end |
#name ⇒ Object
The filename.
20 21 22 |
# File 'lib/nvx/sds/APIClasses/fsfileattributes.rb', line 20 def name @name end |
#path ⇒ Object
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_bytes ⇒ Object
The size of the file.
35 36 37 |
# File 'lib/nvx/sds/APIClasses/fsfileattributes.rb', line 35 def size_bytes @size_bytes end |