Class: Logaling::GlossarySources::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/logaling/glossary_sources/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(relative_source_path, glossary) ⇒ Base

Returns a new instance of Base.



23
24
25
26
# File 'lib/logaling/glossary_sources/base.rb', line 23

def initialize(relative_source_path, glossary)
  @source_path = relative_source_path
  @glossary = glossary
end

Instance Attribute Details

#glossaryObject (readonly)

Returns the value of attribute glossary.



21
22
23
# File 'lib/logaling/glossary_sources/base.rb', line 21

def glossary
  @glossary
end

#source_pathObject (readonly)

Returns the value of attribute source_path.



21
22
23
# File 'lib/logaling/glossary_sources/base.rb', line 21

def source_path
  @source_path
end

Instance Method Details

#absolute_pathObject



41
42
43
# File 'lib/logaling/glossary_sources/base.rb', line 41

def absolute_path
  @glossary.project.repository.expand_path(@source_path)
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


28
29
30
31
# File 'lib/logaling/glossary_sources/base.rb', line 28

def eql?(other)
  return false unless self.class == other.class
  source_path == other.source_path
end

#hashObject



33
34
35
# File 'lib/logaling/glossary_sources/base.rb', line 33

def hash
  @source_path.hash
end

#mtimeObject



37
38
39
# File 'lib/logaling/glossary_sources/base.rb', line 37

def mtime
  File.mtime(absolute_path)
end