Class: Packages::Debian::FileEntry

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
app/models/packages/debian/file_entry.rb

Constant Summary collapse

DIGESTS =
%i[md5 sha1 sha256].freeze
FILENAME_REGEX =
%r{\A[a-zA-Z0-9][a-zA-Z0-9_.~+-]*\z}

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#filenameObject

Returns the value of attribute filename.



11
12
13
# File 'app/models/packages/debian/file_entry.rb', line 11

def filename
  @filename
end

#md5sumObject

Returns the value of attribute md5sum.



11
12
13
# File 'app/models/packages/debian/file_entry.rb', line 11

def md5sum
  @md5sum
end

#package_fileObject

Returns the value of attribute package_file.



11
12
13
# File 'app/models/packages/debian/file_entry.rb', line 11

def package_file
  @package_file
end

#priorityObject

Returns the value of attribute priority.



11
12
13
# File 'app/models/packages/debian/file_entry.rb', line 11

def priority
  @priority
end

#sectionObject

Returns the value of attribute section.



11
12
13
# File 'app/models/packages/debian/file_entry.rb', line 11

def section
  @section
end

#sha1sumObject

Returns the value of attribute sha1sum.



11
12
13
# File 'app/models/packages/debian/file_entry.rb', line 11

def sha1sum
  @sha1sum
end

#sha256sumObject

Returns the value of attribute sha256sum.



11
12
13
# File 'app/models/packages/debian/file_entry.rb', line 11

def sha256sum
  @sha256sum
end

#sizeObject

Returns the value of attribute size.



11
12
13
# File 'app/models/packages/debian/file_entry.rb', line 11

def size
  @size
end

Instance Method Details

#componentObject



24
25
26
27
28
29
# File 'app/models/packages/debian/file_entry.rb', line 24

def component
  return 'main' if section.blank?
  return 'main' unless section.include?('/')

  section.split('/')[0]
end