class Spoom::Coverage::D3::Timeline::Calls

Public Class Methods

new(id, snapshots) click to toggle source
Calls superclass method Spoom::Coverage::D3::Timeline::new
# File lib/spoom/coverage/d3/timeline.rb, line 448
def initialize(id, snapshots)
  keys = ['false', 'true']
  data = snapshots.map do |snapshot|
    {
      timestamp: snapshot.commit_timestamp,
      commit: snapshot.commit_sha,
      total: snapshot.calls_typed + snapshot.calls_untyped,
      values: { true: snapshot.calls_typed, false: snapshot.calls_untyped },
    }
  end
  super(id, data, keys)
end

Public Instance Methods

tooltip() click to toggle source
# File lib/spoom/coverage/d3/timeline.rb, line 462
          def tooltip
            <<~JS
              function tooltip_#{id}(d) {
                tooltipTimeline(d, "calls");
              }
            JS
          end