Class: Cir::StoredFile
- Inherits:
-
Object
- Object
- Cir::StoredFile
- Defined in:
- lib/cir/stored_file.rb
Overview
Represents metadata about stored file.
Instance Attribute Summary collapse
-
#file_path ⇒ Object
readonly
Full file path of the original file location.
-
#repository_location ⇒ Object
readonly
Location in the repository with stored and versioned copy of the file.
Instance Method Summary collapse
-
#diff ⇒ Object
Generate diff using DiffManager.
-
#initialize(attrs = {}) ⇒ StoredFile
constructor
Constructor that will optionally populate attributes.
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_path ⇒ Object (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_location ⇒ Object (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
#diff ⇒ Object
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 |