Class: JsDuck::Welcome
- Inherits:
-
Object
- Object
- JsDuck::Welcome
- Defined in:
- lib/jsduck/welcome.rb
Class Method Summary collapse
-
.create(filename) ⇒ Object
Creates Welcome object from filename.
Instance Method Summary collapse
-
#initialize(filename) ⇒ Welcome
constructor
Parses welcome HTML file with content for welcome page.
-
#to_html ⇒ Object
Returns the HTML.
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_html ⇒ Object
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 |