Class: Piggly::Tags::EvaluationTag

Inherits:
AbstractTag show all
Defined in:
lib/piggly/tags.rb

Direct Known Subclasses

BlockTag, UnconditionalBranchTag

Constant Summary

Constants inherited from AbstractTag

AbstractTag::PATTERN

Instance Attribute Summary collapse

Attributes inherited from AbstractTag

#id

Instance Method Summary collapse

Methods inherited from AbstractTag

#tap

Constructor Details

#initialize(*args) ⇒ EvaluationTag

Returns a new instance of EvaluationTag.



34
35
36
37
# File 'lib/piggly/tags.rb', line 34

def initialize(*args)
  clear
  super
end

Instance Attribute Details

#ranObject (readonly)

Returns the value of attribute ran.



32
33
34
# File 'lib/piggly/tags.rb', line 32

def ran
  @ran
end

Instance Method Details

#==(other) ⇒ Object



68
69
70
# File 'lib/piggly/tags.rb', line 68

def ==(other)
  @id == other.id and @ran == other.ran
end

#clearObject

Resets code coverage



64
65
66
# File 'lib/piggly/tags.rb', line 64

def clear
  @ran = false
end

#complete?Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/piggly/tags.rb', line 55

def complete?
  @ran
end

#descriptionObject



59
60
61
# File 'lib/piggly/tags.rb', line 59

def description
  @ran ? "full coverage" : "never evaluated"
end

#ping(value) ⇒ Object



43
44
45
# File 'lib/piggly/tags.rb', line 43

def ping(value)
  @ran = true
end

#styleObject



47
48
49
# File 'lib/piggly/tags.rb', line 47

def style
  "c#{@ran ? "1" : "0"}"
end

#to_fObject



51
52
53
# File 'lib/piggly/tags.rb', line 51

def to_f
  @ran ? 100.0 : 0.0
end

#typeObject



39
40
41
# File 'lib/piggly/tags.rb', line 39

def type
  :block
end