class FakeFtp::File
Attributes
Public Class Methods
Source
# File lib/fake_ftp/file.rb, line 9 def initialize(name = nil, data = nil, type = nil, last_modified_time = Time.now) @created = Time.now @name = name @data = data # FIXME: this is far too ambiguous. args should not mean different # things in different contexts. data_is_bytes = (data.nil? || data.is_a?(Integer)) @bytes = data_is_bytes ? data : data.to_s.length @data = data_is_bytes ? nil : data @type = type @last_modified_time = last_modified_time.utc end
Public Instance Methods
Source
# File lib/fake_ftp/file.rb, line 27 def data=(data) @data = data @bytes = @data.nil? ? nil : data.length end