Class: Copernicium::FileObj
- Inherits:
-
Object
- Object
- Copernicium::FileObj
- Defined in:
- lib/workspace.rb
Instance Attribute Summary collapse
-
#history ⇒ Object
readonly
Returns the value of attribute history.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #==(rhs) ⇒ Object
-
#base ⇒ Object
fix for deployment.
-
#initialize(path, ids) ⇒ FileObj
constructor
A new instance of FileObj.
-
#last ⇒ Object
returns most recent file id in the snapshot it was saved in.
Constructor Details
#initialize(path, ids) ⇒ FileObj
Returns a new instance of FileObj.
7 8 9 10 11 |
# File 'lib/workspace.rb', line 7 def initialize(path, ids) @base = File.dirname(path) @history = ids @path = path end |
Instance Attribute Details
#history ⇒ Object (readonly)
Returns the value of attribute history.
6 7 8 |
# File 'lib/workspace.rb', line 6 def history @history end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
6 7 8 |
# File 'lib/workspace.rb', line 6 def path @path end |
Instance Method Details
#==(rhs) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/workspace.rb', line 13 def ==(rhs) if rhs.is_a? String @path == rhs else @path == rhs.path end end |
#base ⇒ Object
fix for deployment
21 22 23 24 |
# File 'lib/workspace.rb', line 21 def base # fix for deployment @base = File.dirname(@path) @base end |
#last ⇒ Object
returns most recent file id in the snapshot it was saved in
27 |
# File 'lib/workspace.rb', line 27 def last() @history.last end |