class Fsinv::DirectoryDescription
Attributes
file_count[RW]
file_list[RW]
item_count[RW]
Public Class Methods
new(path, reduced_scan = false)
click to toggle source
Calls superclass method
Fsinv::BaseDescription::new
# File lib/fsinv/directorydescription.rb, line 12 def initialize(path, reduced_scan = false) super(path,reduced_scan) @file_list = [] @file_count = 0 @item_count = 0 end
Public Instance Methods
as_json(options = { })
click to toggle source
# File lib/fsinv/directorydescription.rb, line 30 def as_json(options = { }) return to_hash end
marshal_dump()
click to toggle source
# File lib/fsinv/directorydescription.rb, line 38 def marshal_dump h = self.to_json h.delete("type") return h end
marshal_load(data)
click to toggle source
# File lib/fsinv/directorydescription.rb, line 45 def marshal_load(data) self.path = data['path'] self.bytes = data['bytes'] self.ctime = data['ctime'] if data['ctime'].exists? self.mtime = data['mtime'] if data['mtime'].exists? self.file_count = data['file_count'] if data['file_count'].exists? self.item_count = data['item_count'] if data['item_count'].exists? self.osx_tags = data['osx_tags'] if data['osx_tags'].exists? self.fshugo_tags = data['fshugo_tags'] if data['fshugo_tags'].exists? self.file_list = data['file_list'] end
to_hash()
click to toggle source
Calls superclass method
Fsinv::BaseDescription#to_hash
# File lib/fsinv/directorydescription.rb, line 21 def to_hash h = { "type" => "directory" } h = h.merge(super.to_hash) h["file_count"] = @file_count h["item_count"] = @item_count h["file_list"] = @file_list return h end
to_json(*a)
click to toggle source
# File lib/fsinv/directorydescription.rb, line 34 def to_json(*a) return as_json.to_json(*a) end