class Nexpose::File

File or directory on an asset.

Attributes

attributes[R]

File attributes.

directory[R]

Whether the file is a directory.

name[R]

Name of the file.

size[R]

Size of the file.

Public Class Methods

new(name = nil, size = 0, directory = false, attributes = []) click to toggle source
# File lib/nexpose/asset.rb, line 234
def initialize(name = nil, size = 0, directory = false, attributes = [])
  @name, @size, @directory, @attributes = name, size, directory, attributes
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/nexpose/asset.rb, line 249
def <=>(other)
  c = name <=> other.name
  return c unless c.zero?
  c = size <=> other.size
  return c unless c.zero?
  c = directory <=> other.directory
  return c unless c.zero?
  attributes <=> other.attributes
end
==(other) click to toggle source
# File lib/nexpose/asset.rb, line 259
def ==(other)
  eql?(other)
end
directory?() click to toggle source
# File lib/nexpose/asset.rb, line 238
def directory?
  directory
end
eql?(other) click to toggle source
# File lib/nexpose/asset.rb, line 263
def eql?(other)
  name.eql?(other.name) && size.eql?(other.size) && directory.eql?(other.directory) && attributes.eql?(other.attributes)
end
to_h() click to toggle source
# File lib/nexpose/asset.rb, line 242
def to_h
  { name: name,
    size: size,
    directory: directory,
    attributes: Attributes.to_hash(attributes) }
end