Class: CapturefulFormatter::Printer::Template

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/captureful_formatter/printer.rb

Instance Method Summary collapse

Instance Method Details

#background_by_status(status) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/captureful_formatter/printer.rb', line 13

def background_by_status(status)
  case status
  when :passed then "bg-success"
  when :pending then "bg-warning"
  when :failed then "bg-danger"
  else "bg-info"
  end
end

#render(template) ⇒ Object



9
10
11
# File 'lib/captureful_formatter/printer.rb', line 9

def render(template)
  ERB.new(template).result(binding)
end