class SMB::ClientHelper::LsItem
Constants
- REGEX
Attributes
change_time[RW]
name[RW]
size[RW]
type[RW]
Public Class Methods
from_line(line)
click to toggle source
# File lib/smb/client/ls_item.rb, line 22 def self.from_line(line) match_data = REGEX.match line return nil unless match_data item = LsItem.new item.name = match_data['name'] item.type = match_data['type'] item.size = match_data['size'].to_i item.change_time = Time.parse match_data['change_time'] item end
Public Instance Methods
directory?()
click to toggle source
# File lib/smb/client/ls_item.rb, line 14 def directory? %w[D].include? @type end
file?()
click to toggle source
# File lib/smb/client/ls_item.rb, line 10 def file? %w[A N].include? @type end