Class: ActiveRecordFormatterHelpers::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/activerecord/helpers/report.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(collector) ⇒ Report

Returns a new instance of Report.



5
6
7
8
9
10
11
# File 'lib/rspec/activerecord/helpers/report.rb', line 5

def initialize(collector)
  @collector = collector

  @report_dir   = Rails.root.join("tmp", "profile")
  @report_path  = report_dir.join(timestamped_filename)
  @default_path = report_dir.join('ar_most_recent.txt')
end

Instance Attribute Details

#collectorObject (readonly)

Returns the value of attribute collector.



3
4
5
# File 'lib/rspec/activerecord/helpers/report.rb', line 3

def collector
  @collector
end

#default_pathObject (readonly)

Returns the value of attribute default_path.



3
4
5
# File 'lib/rspec/activerecord/helpers/report.rb', line 3

def default_path
  @default_path
end

#report_dirObject (readonly)

Returns the value of attribute report_dir.



3
4
5
# File 'lib/rspec/activerecord/helpers/report.rb', line 3

def report_dir
  @report_dir
end

#report_pathObject (readonly)

Returns the value of attribute report_path.



3
4
5
# File 'lib/rspec/activerecord/helpers/report.rb', line 3

def report_path
  @report_path
end

Instance Method Details

#writeObject



13
14
15
16
# File 'lib/rspec/activerecord/helpers/report.rb', line 13

def write
  write_file(file_path: report_path)
  write_file(file_path: default_path)
end