Method: Net::SFTP::Protocol::V04::Attributes#initialize
- Defined in:
- lib/net/sftp/protocol/04/attributes.rb
#initialize(attributes = {}) ⇒ Attributes
Create a new Attributes instance with the given attributes. The following keys are supported:
- :type
-
the type of the item (integer, one of the T_ constants)
- :size
-
the size of the item (integer)
- :uid
-
the user-id that owns the file (integer)
- :gid
-
the group-id that owns the file (integer)
- :owner
-
the name of the user that owns the file (string)
- :group
-
the name of the group that owns the file (string)
- :permissions
-
the permissions on the file (integer, e.g. 0755)
- :atime
-
the access time of the file (integer, seconds since epoch)
- :atime_nseconds
-
the nanosecond component of atime (integer)
- :createtime
-
the time at which the file was created (integer, seconds since epoch)
- :createtime_nseconds
-
the nanosecond component of createtime (integer)
- :mtime
-
the modification time of the file (integer, seconds since epoch)
- :mtime_nseconds
-
the nanosecond component of mtime (integer)
- :acl
-
an array of ACL entries for the item
- :extended
-
a hash of name/value pairs identifying extended info
All of them default to nil if omitted, except for type, which defaults to T_REGULAR.
124 125 126 127 |
# File 'lib/net/sftp/protocol/04/attributes.rb', line 124 def initialize(attributes={}) super attributes[:type] ||= T_REGULAR end |