Class: NCover::ReportFilterBase

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from UpdateAttributes

#<<, #update_attributes

Constructor Details

#initialize(item_type, params = {}) ⇒ ReportFilterBase

Returns a new instance of ReportFilterBase.



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

def initialize(item_type, params={})
  @filter = ""
  @item_type = item_type
  @is_regex = false
  @filter_type = :exclude
  update_attributes(params) unless params.nil?
  super()
end

Instance Attribute Details

#filterObject

Returns the value of attribute filter.



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

def filter
  @filter
end

#filter_typeObject

Returns the value of attribute filter_type.



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

def filter_type
  @filter_type
end

#is_regexObject

Returns the value of attribute is_regex.



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

def is_regex
  @is_regex
end

#item_typeObject

Returns the value of attribute item_type.



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

def item_type
  @item_type
end

Instance Method Details

#get_filter_optionsObject



18
19
20
21
22
23
24
# File 'lib/albacore/ncoverreports/reportfilterbase.rb', line 18

def get_filter_options
  filter = "\"#{@filter}\""
  filter << ":#{@item_type}"
  filter << ":#{@is_regex}"
  filter << ":#{(@filter_type == :include)}"
  filter
end