Class: Md2Pdf::TemplateLocation

Inherits:
Struct
  • Object
show all
Defined in:
lib/md2pdf/template.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#locationObject

Returns the value of attribute location

Returns:

  • (Object)

    the current value of location



40
41
42
# File 'lib/md2pdf/template.rb', line 40

def location
  @location
end

Instance Method Details

#contains?(path) ⇒ Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/md2pdf/template.rb', line 44

def contains?(path)
  File.exists?(path_for(path))
end

#listObject



47
48
49
# File 'lib/md2pdf/template.rb', line 47

def list
  Dir[File.join(location,"*")].map {|f| File.basename(f)}
end

#path_for(path) ⇒ Object



41
42
43
# File 'lib/md2pdf/template.rb', line 41

def path_for(path)
  File.join(location, path)
end