Class: Hubba::Report
- Inherits:
-
Object
- Object
- Hubba::Report
- Defined in:
- lib/hubba/reports.rb
Direct Known Subclasses
ReportStars, ReportSummary, ReportTimeline, ReportTrending, ReportUpdates
Instance Method Summary collapse
-
#initialize(stats_or_hash_or_path = Hubba.stats) ⇒ Report
constructor
A new instance of Report.
- #save(path) ⇒ Object
Constructor Details
#initialize(stats_or_hash_or_path = Hubba.stats) ⇒ Report
Returns a new instance of Report.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/hubba/reports.rb', line 5 def initialize( stats_or_hash_or_path=Hubba.stats ) ## puts "[debug] Report#initialize:" ## pp stats_or_hash_or_path if stats_or_hash_or_path.is_a?( String ) @stats = if stats_or_hash_or_path.is_a?( String ) || stats_or_hash_or_path.is_a?( Hash ) hash_or_path = stats_or_hash_or_path Hubba.stats( hash_or_path ) else stats_or_hash_or_path ## assume Summary/Stats - todo/fix: double check!!! end end |
Instance Method Details
#save(path) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/hubba/reports.rb', line 18 def save( path ) buf = build puts "writing report >#{path}< ..." File.open( path, "w:utf-8" ) do |f| f.write( buf ) end end |