class Ebookie::Document::Config

Attributes

cover[RW]
creator[RW]
date[RW]
destination[RW]
language[RW]
publisher[RW]
rights[RW]
source[RW]
subject[RW]
template[RW]
title[RW]

Public Instance Methods

cover=(path) click to toggle source
# File lib/ebookie/document/config.rb, line 25
def cover=(path)
  if File.exists?(path) || path.match(/http[s]?:\/\//)
    if %w(.png .pdf).include? File.extname(path)
      @cover = Pathname.new(path)
    else
      Ebookie.logger.warn "Cover file is not a valid"
    end
  else
    Ebookie.logger.warn "Cover file does not exist"
  end
end
slug() click to toggle source
# File lib/ebookie/document/config.rb, line 37
def slug
  title.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')
end