Class: BiblioTech::Backups::FileRecord

Inherits:
Object
  • Object
show all
Defined in:
lib/bibliotech/backups/file_record.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, timestamp) ⇒ FileRecord

Returns a new instance of FileRecord.



6
7
8
9
10
# File 'lib/bibliotech/backups/file_record.rb', line 6

def initialize(path, timestamp)
  @path, @timestamp = path, timestamp
  @keep = false
  @scheduled_by = []
end

Instance Attribute Details

#keepObject

Returns the value of attribute keep.



4
5
6
# File 'lib/bibliotech/backups/file_record.rb', line 4

def keep
  @keep
end

#pathObject

Returns the value of attribute path.



4
5
6
# File 'lib/bibliotech/backups/file_record.rb', line 4

def path
  @path
end

#scheduled_byObject

Returns the value of attribute scheduled_by.



4
5
6
# File 'lib/bibliotech/backups/file_record.rb', line 4

def scheduled_by
  @scheduled_by
end

#timestampObject

Returns the value of attribute timestamp.



4
5
6
# File 'lib/bibliotech/backups/file_record.rb', line 4

def timestamp
  @timestamp
end

Instance Method Details

#in_schedule(name) ⇒ Object



16
17
18
19
# File 'lib/bibliotech/backups/file_record.rb', line 16

def in_schedule(name)
  @scheduled_by << name
  @keep = true
end

#keep?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/bibliotech/backups/file_record.rb', line 12

def keep?
  !!@keep
end