Class: TurnipFormatter::StepTemplate::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/turnip_formatter/step_template/base.rb

Direct Known Subclasses

Exception

Class Method Summary collapse

Class Method Details

.cssObject

Return SCSS string that be used in this class



28
29
30
# File 'lib/turnip_formatter/step_template/base.rb', line 28

def css
  ''
end

.hooksObject



21
22
23
# File 'lib/turnip_formatter/step_template/base.rb', line 21

def hooks
  @hooks ||= { passed: [], failed: [], pending: [] }
end

.inherited(child) ⇒ Object



5
6
7
# File 'lib/turnip_formatter/step_template/base.rb', line 5

def inherited(child)
  TurnipFormatter.step_templates << child.new
end

.on_failed(template) ⇒ Object



13
14
15
# File 'lib/turnip_formatter/step_template/base.rb', line 13

def on_failed(template)
  hooks[:failed] << template
end

.on_passed(template) ⇒ Object



9
10
11
# File 'lib/turnip_formatter/step_template/base.rb', line 9

def on_passed(template)
  hooks[:passed] << template
end

.on_pending(template) ⇒ Object



17
18
19
# File 'lib/turnip_formatter/step_template/base.rb', line 17

def on_pending(template)
  hooks[:pending] << template
end