Class: Cuporter::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/cuporter/report/report.rb

Direct Known Subclasses

NameReport, TagReport

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input_file_pattern, filter_args = nil, title = nil) ⇒ Report

Returns a new instance of Report.



7
8
9
10
11
# File 'lib/cuporter/report/report.rb', line 7

def initialize(input_file_pattern, filter_args = nil, title = nil)
  @input_file_pattern = input_file_pattern
  @filter = Filter.new(filter_args || {})
  @title = title
end

Instance Attribute Details

#filterObject (readonly)

Returns the value of attribute filter.



5
6
7
# File 'lib/cuporter/report/report.rb', line 5

def filter
  @filter
end

#titleObject (readonly)

Returns the value of attribute title.



5
6
7
# File 'lib/cuporter/report/report.rb', line 5

def title
  @title
end

Class Method Details

.create(type, input_file_pattern, filter_args = nil, title = nil) ⇒ Object



17
18
19
20
# File 'lib/cuporter/report/report.rb', line 17

def self.create(type, input_file_pattern, filter_args = nil, title = nil)
  klass = Cuporter.const_get("#{type.downcase}Report".to_class_name)
  klass.new(input_file_pattern, filter_args, title)
end

Instance Method Details

#filesObject



13
14
15
# File 'lib/cuporter/report/report.rb', line 13

def files
  Dir[@input_file_pattern].collect {|f| File.expand_path f}
end