Class: JekyllRecker::Graphs::Swears
- Inherits:
-
Object
- Object
- JekyllRecker::Graphs::Swears
- Includes:
- Base
- Defined in:
- lib/jekyll_recker/graphs.rb
Overview
Swears Chart
Instance Attribute Summary collapse
-
#results ⇒ Object
readonly
Returns the value of attribute results.
Attributes included from Base
Instance Method Summary collapse
-
#initialize(site) ⇒ Swears
constructor
A new instance of Swears.
- #write ⇒ Object
Methods included from Base
Constructor Details
#initialize(site) ⇒ Swears
Returns a new instance of Swears.
71 72 73 74 75 |
# File 'lib/jekyll_recker/graphs.rb', line 71 def initialize(site) @results = site.data['stats']['swears'].clone @results.delete('total') @graphs_dir = site.graphs_dir end |
Instance Attribute Details
#results ⇒ Object (readonly)
Returns the value of attribute results.
69 70 71 |
# File 'lib/jekyll_recker/graphs.rb', line 69 def results @results end |
Instance Method Details
#write ⇒ Object
77 78 79 80 81 82 83 84 85 |
# File 'lib/jekyll_recker/graphs.rb', line 77 def write g = ::Gruff::Pie.new('800x600') g.theme = Gruff::Themes::PASTEL g.hide_legend = false g.legend_at_bottom = true g.minimum_value = 0 results.each { |w, n| g.data w, n } g.write(graphs_join('swears.png')) end |