Class: Page

Inherits:
Mustache
  • Object
show all
Defined in:
lib/bubbler/page.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Page

Returns a new instance of Page.



7
8
9
10
# File 'lib/bubbler/page.rb', line 7

def initialize args
  @names    = graph_names(args[:graphs])
  @graphs   = graph_data(args[:graphs])
end

Instance Attribute Details

#graphsObject (readonly)

Returns the value of attribute graphs.



5
6
7
# File 'lib/bubbler/page.rb', line 5

def graphs
  @graphs
end

#namesObject (readonly)

Returns the value of attribute names.



5
6
7
# File 'lib/bubbler/page.rb', line 5

def names
  @names
end

Class Method Details

.html(args) ⇒ Object



12
13
14
15
16
# File 'lib/bubbler/page.rb', line 12

def self.html args
  page = new(args)
  page.template = find_template(args.fetch(:template, "default"))
  page.render
end