Class: JsDuck::Welcome

Inherits:
Object
  • Object
show all
Defined in:
lib/jsduck/welcome.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ Welcome

Parses welcome HTML file with content for welcome page.



16
17
18
# File 'lib/jsduck/welcome.rb', line 16

def initialize(filename)
  @html = IO.read(filename)
end

Class Method Details

.create(filename) ⇒ Object

Creates Welcome object from filename.



7
8
9
10
11
12
13
# File 'lib/jsduck/welcome.rb', line 7

def self.create(filename)
  if filename
    Welcome.new(filename)
  else
    NullObject.new(:to_html => "")
  end
end

Instance Method Details

#to_htmlObject

Returns the HTML



21
22
23
# File 'lib/jsduck/welcome.rb', line 21

def to_html
  "<div id='welcome-content' style='display:none'>#{@html}</div>"
end