Class: Copernicium::FileObj

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#historyObject (readonly)

Returns the value of attribute history.



6
7
8
# File 'lib/workspace.rb', line 6

def history
  @history
end

#pathObject (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

#baseObject

fix for deployment



21
22
23
24
# File 'lib/workspace.rb', line 21

def base # fix for deployment
  @base = File.dirname(@path)
  @base
end

#lastObject

returns most recent file id in the snapshot it was saved in



27
# File 'lib/workspace.rb', line 27

def last() @history.last end