Class: Hubba::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/hubba/reports.rb

Instance Method Summary collapse

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