Class: Softcover::App

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/softcover/server/app.rb

Instance Method Summary collapse

Instance Method Details

#get_chapterObject



96
97
98
99
100
101
# File 'lib/softcover/server/app.rb', line 96

def get_chapter
  if params[:chapter_slug]
    @chapter = @manifest.find_chapter_by_slug(params[:chapter_slug])
    raise Sinatra::NotFound unless @chapter
  end
end

#image_filename(path, extension) ⇒ Object

Returns the image filename for the local document.



62
63
64
# File 'lib/softcover/server/app.rb', line 62

def image_filename(path, extension)
  "html/images/#{path}.#{extension}"
end