Class: Net::SFTP::Protocol::V01::Name

Class | Net::SFTP::Protocol::V01::Name
In: | lib/net/sftp/protocol/01/name.rb lib/net/sftp/protocol/01/name.rb
Parent: | Object

Represents a single named item on the remote server. This includes the name, attributes about the item, and the "longname", which is intended for use when displaying directory data, and has no specified format.

### Methods

directory? directory? file? file? new new symlink? symlink?

### Attributes

attributes | [R] | The Attributes object describing this item.
attributes | [R] | The Attributes object describing this item.
longname | [R] | The display-ready name of the item, possibly with other attributes.
longname | [R] | The display-ready name of the item, possibly with other attributes.
name | [R] | The name of the item on the remote server.
name | [R] | The name of the item on the remote server.

### Public Class methods

new(name, longname, attributes)

Create a new Name object with the given name, longname, and attributes.

[Source]

        # File lib/net/sftp/protocol/01/name.rb, line 17
    17:     def initialize(name, longname, attributes)
    18:       @name, @longname, @attributes = name, longname, attributes
    19:     end

new(name, longname, attributes)

Create a new Name object with the given name, longname, and attributes.

[Source]

        # File lib/net/sftp/protocol/01/name.rb, line 17
    17:     def initialize(name, longname, attributes)
    18:       @name, @longname, @attributes = name, longname, attributes
    19:     end

### Public Instance methods

directory?()

Returns `true` if the item appears to be a directory. It does this by examining the attributes. If there is insufficient information in the attributes, this will return nil, rather than a boolean.

[Source]

        # File lib/net/sftp/protocol/01/name.rb, line 24
    24:     def directory?
    25:       attributes.directory?
    26:     end

directory?()

Returns `true` if the item appears to be a directory. It does this by examining the attributes. If there is insufficient information in the attributes, this will return nil, rather than a boolean.

[Source]

        # File lib/net/sftp/protocol/01/name.rb, line 24
    24:     def directory?
    25:       attributes.directory?
    26:     end

file?()

Returns `true` if the item appears to be a regular file. It does this by examining the attributes. If there is insufficient information in the attributes, this will return nil, rather than a boolean.

[Source]

        # File lib/net/sftp/protocol/01/name.rb, line 38
    38:     def file?
    39:       attributes.file?
    40:     end

file?()

Returns `true` if the item appears to be a regular file. It does this by examining the attributes. If there is insufficient information in the attributes, this will return nil, rather than a boolean.

[Source]

        # File lib/net/sftp/protocol/01/name.rb, line 38
    38:     def file?
    39:       attributes.file?
    40:     end

symlink?()

Returns `true` if the item appears to be a symlink. It does this by examining the attributes. If there is insufficient information in the attributes, this will return nil, rather than a boolean.

[Source]

        # File lib/net/sftp/protocol/01/name.rb, line 31
    31:     def symlink?
    32:       attributes.symlink?
    33:     end

symlink?()

Returns `true` if the item appears to be a symlink. It does this by examining the attributes. If there is insufficient information in the attributes, this will return nil, rather than a boolean.

[Source]

        # File lib/net/sftp/protocol/01/name.rb, line 31
    31:     def symlink?
    32:       attributes.symlink?
    33:     end

[Validate]