Class: DiskRecord

Inherits:
Object
  • Object
show all
Defined in:
service/records/disk_records.rb

Overview

Disk Record Model class

Direct Known Subclasses

CreateDiskRecord, DeleteDiskRecord

Defined Under Namespace

Classes: CreateDiskRecord, DeleteDiskRecord

Instance Method Summary collapse

Instance Method Details

#sortableObject

Splits itself into Create- and Delete-(if snap has been deleted) DiskRecord



60
61
62
63
64
65
66
# File 'service/records/disk_records.rb', line 60

def sortable
  if self.del then
    [CreateDiskRecord.new(values), DeleteDiskRecord.new(values)]
  else
    CreateDiskRecord.new(values)
  end
end

#type_symObject

State hash key generator, e.g. backup disk would be :backup_disk



19
20
21
# File 'service/records/disk_records.rb', line 19

def type_sym
  "#{type}_disk".to_sym
end

#valuesObject

Record values withoud DB key



55
56
57
# File 'service/records/disk_records.rb', line 55

def values
  @values.without(:key)
end