Class: Spoom::Coverage::Cards::SorbetIntro

Inherits:
Erb show all
Defined in:
lib/spoom/coverage/report.rb

Constant Summary

Constants inherited from Card

Card::TEMPLATE

Instance Attribute Summary

Attributes inherited from Card

#body, #title

Instance Method Summary collapse

Methods inherited from Erb

#html

Methods inherited from Template

#get_binding, #html

Constructor Details

#initialize(sorbet_intro_commit: nil, sorbet_intro_date: nil) ⇒ SorbetIntro

: (?sorbet_intro_commit: String?, ?sorbet_intro_date: Time?) -> void



216
217
218
219
# File 'lib/spoom/coverage/report.rb', line 216

def initialize(sorbet_intro_commit: nil, sorbet_intro_date: nil) # rubocop:disable Lint/MissingSuper
  @sorbet_intro_commit = sorbet_intro_commit
  @sorbet_intro_date = sorbet_intro_date
end

Instance Method Details

#erbObject

: -> String



223
224
225
226
227
228
229
230
# File 'lib/spoom/coverage/report.rb', line 223

def erb
  <<~ERB
    <div class="text-center" style="margin-top: 30px">
      Typchecked by Sorbet since <b>#{@sorbet_intro_date&.strftime("%F")}</b>
      (commit <b>#{@sorbet_intro_commit}</b>).
    </div>
  ERB
end