class FlickrOfflineGallery::PathManager

Attributes

base_path[R]

Public Class Methods

new(base_path, slug) click to toggle source
# File lib/flickr_offline_gallery/path_manager.rb, line 6
def initialize(base_path, slug)
  @base_path = base_path
  @slug     = slug
end

Public Instance Methods

back_to_index() click to toggle source
# File lib/flickr_offline_gallery/path_manager.rb, line 31
def back_to_index
  "../#{@slug}.html"
end
filename_for_photo(photo_id, extension) click to toggle source
# File lib/flickr_offline_gallery/path_manager.rb, line 27
def filename_for_photo(photo_id, extension)
  "#{photo_id}.#{extension}"
end
full_path_for(photo_id, extension) click to toggle source
# File lib/flickr_offline_gallery/path_manager.rb, line 19
def full_path_for(photo_id, extension)
  File.join(photo_output_path, filename_for_photo(photo_id, extension))
end
index_page() click to toggle source
# File lib/flickr_offline_gallery/path_manager.rb, line 15
def index_page
  "#{photo_output_path}.html"
end
photo_output_path() click to toggle source
# File lib/flickr_offline_gallery/path_manager.rb, line 11
def photo_output_path
  File.join(base_path, @slug)
end
relative_path_for(photo_id, extension) click to toggle source
# File lib/flickr_offline_gallery/path_manager.rb, line 23
def relative_path_for(photo_id, extension)
  File.join(@slug, filename_for_photo(photo_id, extension))
end