Class: NCover::CodeCoverageBase

Inherits:
Object
  • Object
show all
Includes:
UpdateAttributes
Defined in:
lib/albacore/ncoverreports/codecoveragebase.rb

Direct Known Subclasses

BranchCoverage, MethodCoverage, SymbolCoverage

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from UpdateAttributes

#<<, #update_attributes

Constructor Details

#initialize(coverage_type, params = {}) ⇒ CodeCoverageBase

Returns a new instance of CodeCoverageBase.



9
10
11
12
13
14
15
# File 'lib/albacore/ncoverreports/codecoveragebase.rb', line 9

def initialize(coverage_type, params={})
  @coverage_type = coverage_type
  @minimum = 0
  @item_type = :View
  update_attributes(params) unless params.nil?
  super()
end

Instance Attribute Details

#coverage_typeObject

Returns the value of attribute coverage_type.



7
8
9
# File 'lib/albacore/ncoverreports/codecoveragebase.rb', line 7

def coverage_type
  @coverage_type
end

#item_typeObject

Returns the value of attribute item_type.



7
8
9
# File 'lib/albacore/ncoverreports/codecoveragebase.rb', line 7

def item_type
  @item_type
end

#minimumObject

Returns the value of attribute minimum.



7
8
9
# File 'lib/albacore/ncoverreports/codecoveragebase.rb', line 7

def minimum
  @minimum
end

Instance Method Details

#get_coverage_optionsObject



17
18
19
20
21
22
# File 'lib/albacore/ncoverreports/codecoveragebase.rb', line 17

def get_coverage_options
  options = "#{@coverage_type}"
  options << ":#{@minimum}" unless @minimum.nil?
  options << ":#{@item_type}" unless @item_type.nil?
  options
end