Class: ReqresRspec::Formatters::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/reqres_rspec/formatters/base.rb

Direct Known Subclasses

HTML, JSON, Pdf

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(records) ⇒ Base

Returns a new instance of Base.



4
5
6
7
8
# File 'lib/reqres_rspec/formatters/base.rb', line 4

def initialize(records)
  @records = records
  @output_path = ReqresRspec.configuration.output_path
  @logger = ReqresRspec.logger
end

Instance Attribute Details

#loggerObject (readonly)

Returns the value of attribute logger.



9
10
11
# File 'lib/reqres_rspec/formatters/base.rb', line 9

def logger
  @logger
end

#output_pathObject (readonly)

Returns the value of attribute output_path.



9
10
11
# File 'lib/reqres_rspec/formatters/base.rb', line 9

def output_path
  @output_path
end

#recordsObject (readonly)

Returns the value of attribute records.



9
10
11
# File 'lib/reqres_rspec/formatters/base.rb', line 9

def records
  @records
end

Instance Method Details

#processObject



11
12
13
14
# File 'lib/reqres_rspec/formatters/base.rb', line 11

def process
  cleanup
  write
end