Class: Hubdown::PageBuilder
- Inherits:
-
Object
- Object
- Hubdown::PageBuilder
- Defined in:
- lib/hubdown/page_builder.rb
Instance Method Summary collapse
- #get_page ⇒ Object
-
#initialize(args) ⇒ PageBuilder
constructor
A new instance of PageBuilder.
Constructor Details
#initialize(args) ⇒ PageBuilder
Returns a new instance of PageBuilder.
7 8 9 10 11 12 |
# File 'lib/hubdown/page_builder.rb', line 7 def initialize args @body = args.fetch("body"){ '' } @uri = args.fetch("uri"){ 'https://github.com/knomedia/hubdown' } @filename = args.fetch("filename"){ '' } @style_gen = StyleGenerator.new( @uri ) end |
Instance Method Details
#get_page ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/hubdown/page_builder.rb', line 14 def get_page links = @style_gen.get_css_links body = @body filename = @filename template_path = File.dirname(__FILE__) + "/template.html.erb" template = ERB.new( File.read( template_path ), nil, "-" ) page = template.result(binding) page end |