Class: Cir::StoredFile

Inherits:
Object
  • Object
show all
Defined in:
lib/cir/stored_file.rb

Overview

Represents metadata about stored file.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ StoredFile

Constructor that will optionally populate attributes



29
30
31
32
33
# File 'lib/cir/stored_file.rb', line 29

def initialize(attrs = {})
  attrs.each do |attr, value|
    instance_variable_set "@#{attr}", value
  end
end

Instance Attribute Details

#file_pathObject (readonly)

Full file path of the original file location



21
22
23
# File 'lib/cir/stored_file.rb', line 21

def file_path
  @file_path
end

#repository_locationObject (readonly)

Location in the repository with stored and versioned copy of the file



25
26
27
# File 'lib/cir/stored_file.rb', line 25

def repository_location
  @repository_location
end

Instance Method Details

#diffObject

Generate diff using DiffManager



37
38
39
# File 'lib/cir/stored_file.rb', line 37

def diff
  Cir::DiffManager.create(repository_location, file_path)
end