Class: Spoom::Coverage::D3::Pie::Sigs

Inherits:
Spoom::Coverage::D3::Pie show all
Extended by:
T::Sig
Defined in:
lib/spoom/coverage/d3/pie.rb

Instance Attribute Summary

Attributes inherited from Base

#id

Instance Method Summary collapse

Methods inherited from Spoom::Coverage::D3::Pie

header_script, header_style, #script

Methods inherited from Base

header_script, header_style, #html, #script

Constructor Details

#initialize(id, title, snapshot) ⇒ Sigs

Returns a new instance of Sigs.


159
160
161
# File 'lib/spoom/coverage/d3/pie.rb', line 159

def initialize(id, title, snapshot)
  super(id, title, { true: snapshot.methods_with_sig, false: snapshot.methods_without_sig })
end

Instance Method Details

#tooltipObject


164
165
166
167
168
169
170
# File 'lib/spoom/coverage/d3/pie.rb', line 164

def tooltip
  <<~JS
    function tooltip_#{id}(d) {
      tooltipPie(d, (d.data.key == "true" ? " with" : " without") + " a signature", "methods", sum_#{id})
    }
  JS
end