Class: Cabriolet::Repairer::RecoveredFile

Inherits:
Object
  • Object
show all
Defined in:
lib/cabriolet/repairer.rb

Overview

Recovered file wrapper

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(original_file, data, status) ⇒ RecoveredFile

Returns a new instance of RecoveredFile.



177
178
179
180
181
182
183
184
# File 'lib/cabriolet/repairer.rb', line 177

def initialize(original_file, data, status)
  @name = original_file.name
  @data = data
  @status = status # :complete or :partial
  @attributes = original_file.attributes if original_file.respond_to?(:attributes)
  @date = original_file.date if original_file.respond_to?(:date)
  @time = original_file.time if original_file.respond_to?(:time)
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



175
176
177
# File 'lib/cabriolet/repairer.rb', line 175

def attributes
  @attributes
end

#dataObject (readonly)

Returns the value of attribute data.



175
176
177
# File 'lib/cabriolet/repairer.rb', line 175

def data
  @data
end

#dateObject (readonly)

Returns the value of attribute date.



175
176
177
# File 'lib/cabriolet/repairer.rb', line 175

def date
  @date
end

#nameObject (readonly)

Returns the value of attribute name.



175
176
177
# File 'lib/cabriolet/repairer.rb', line 175

def name
  @name
end

#statusObject (readonly)

Returns the value of attribute status.



175
176
177
# File 'lib/cabriolet/repairer.rb', line 175

def status
  @status
end

#timeObject (readonly)

Returns the value of attribute time.



175
176
177
# File 'lib/cabriolet/repairer.rb', line 175

def time
  @time
end

Instance Method Details

#complete?Boolean

Returns:

  • (Boolean)


186
187
188
# File 'lib/cabriolet/repairer.rb', line 186

def complete?
  @status == :complete
end

#partial?Boolean

Returns:

  • (Boolean)


190
191
192
# File 'lib/cabriolet/repairer.rb', line 190

def partial?
  @status == :partial
end