Class: GDSync::DryRunFileSystem::File

Inherits:
AbstractFile
  • Object
show all
Defined in:
lib/file_system/dry_run.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_fs, _path) ⇒ File

Returns a new instance of File


9
10
11
12
# File 'lib/file_system/dry_run.rb', line 9

def initialize(_fs, _path)
  @fs = _fs
  @path = _path
end

Instance Attribute Details

#fsObject (readonly)

Returns the value of attribute fs


7
8
9
# File 'lib/file_system/dry_run.rb', line 7

def fs
  @fs
end

#pathObject (readonly)

Returns the value of attribute path


7
8
9
# File 'lib/file_system/dry_run.rb', line 7

def path
  @path
end

Instance Method Details

#birthtimeObject


26
27
28
# File 'lib/file_system/dry_run.rb', line 26

def birthtime
  ::DateTime.now
end

#copy_to(_dest_dir) ⇒ Object


45
46
47
# File 'lib/file_system/dry_run.rb', line 45

def copy_to(_dest_dir)
  File.new(::File.join(_dest_dir.path, title))
end

#create_read_ioObject

Raises:


34
35
36
# File 'lib/file_system/dry_run.rb', line 34

def create_read_io
  raise NotSupportedError.new
end

#delete!Object


49
50
# File 'lib/file_system/dry_run.rb', line 49

def delete!
end

#md5Object


30
31
32
# File 'lib/file_system/dry_run.rb', line 30

def md5
  ::Digest::MD5.hexdigest('')
end

#mtimeObject


22
23
24
# File 'lib/file_system/dry_run.rb', line 22

def mtime
  ::DateTime.now
end

#sizeObject


18
19
20
# File 'lib/file_system/dry_run.rb', line 18

def size
  0
end

#titleObject


14
15
16
# File 'lib/file_system/dry_run.rb', line 14

def title
  ::File.basename(path)
end

#update!(_read_io, _mtime) ⇒ Object


41
42
43
# File 'lib/file_system/dry_run.rb', line 41

def update!(_read_io, _mtime)
  self
end

#write_to(_write_io) ⇒ Object


38
39
# File 'lib/file_system/dry_run.rb', line 38

def write_to(_write_io)
end