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



73
74
75
76
77
78
# File 'lib/softcover/server/app.rb', line 73

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.



39
40
41
# File 'lib/softcover/server/app.rb', line 39

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