class JsDuck::Assets
Binds together: Welcome
page, Categories
, Images, Guides
, Videos
, Examples
.
Often we need to pass guides/videos/examples/… to several classes. Having all these assets together in here, means we just need to pass one value instead of 3 or more.
Attributes
categories[R]
examples[R]
guides[R]
images[R]
news[R]
videos[R]
welcome[R]
Public Class Methods
new(relations, opts)
click to toggle source
# File lib/jsduck/assets.rb, line 28 def initialize(relations, opts) @relations = relations @opts = opts doc_formatter = Format::Doc.new(@relations, @opts) @images = Img::DirSet.new(@opts.images, "images") @welcome = Welcome.create(@opts.welcome, doc_formatter) @guides = Guides.create(@opts.guides, doc_formatter, @opts) @videos = Videos.create(@opts.videos) @examples = Examples.create(@opts.examples, @opts) @categories = Categories::Factory.create(@opts.categories, doc_formatter, @relations) @news = News.create(@relations, doc_formatter, @opts) end
Public Instance Methods
write()
click to toggle source
Writes out the assets that can be written out separately: guides, images.
Welcome
page and categories are written in JsDuck::IndexHtml
# File lib/jsduck/assets.rb, line 47 def write @guides.write(@opts.output+"/guides") Img::Writer.copy(@images.all_used, @opts.output+"/images") end