Class: Cuporter::Report
- Inherits:
-
Object
- Object
- Cuporter::Report
- Defined in:
- lib/cuporter/report/report.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#filter ⇒ Object
readonly
Returns the value of attribute filter.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
- #files ⇒ Object
-
#initialize(input_file_pattern, filter_args = nil, title = nil) ⇒ Report
constructor
A new instance of Report.
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
#filter ⇒ Object (readonly)
Returns the value of attribute filter.
5 6 7 |
# File 'lib/cuporter/report/report.rb', line 5 def filter @filter end |
#title ⇒ Object (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
#files ⇒ Object
13 14 15 |
# File 'lib/cuporter/report/report.rb', line 13 def files Dir[@input_file_pattern].collect {|f| File. f} end |