Class: Spoom::Coverage::Cards::Snapshot

Inherits:
Card show all
Extended by:
T::Sig
Defined in:
lib/spoom/coverage/report.rb

Constant Summary collapse

TEMPLATE =
T.let("#{Spoom::SPOOM_PATH}/templates/card_snapshot.erb", String)

Instance Attribute Summary collapse

Attributes inherited from Card

#body, #title

Instance Method Summary collapse

Methods inherited from Template

#erb, #get_binding, #html

Constructor Details

#initialize(snapshot:, title: "Snapshot") ⇒ Snapshot

Returns a new instance of Snapshot.


132
133
134
135
# File 'lib/spoom/coverage/report.rb', line 132

def initialize(snapshot:, title: "Snapshot")
  super(template: TEMPLATE, title: title)
  @snapshot = snapshot
end

Instance Attribute Details

#snapshotObject (readonly)

Returns the value of attribute snapshot.


129
130
131
# File 'lib/spoom/coverage/report.rb', line 129

def snapshot
  @snapshot
end

Instance Method Details

#pie_callsObject


143
144
145
# File 'lib/spoom/coverage/report.rb', line 143

def pie_calls
  D3::Pie::Calls.new('pie_calls', 'Calls', snapshot)
end

#pie_sigilsObject


138
139
140
# File 'lib/spoom/coverage/report.rb', line 138

def pie_sigils
  D3::Pie::Sigils.new('pie_sigils', 'Sigils', snapshot)
end

#pie_sigsObject


148
149
150
# File 'lib/spoom/coverage/report.rb', line 148

def pie_sigs
  D3::Pie::Sigs.new('pie_sigs', 'Sigs', snapshot)
end