Class: Pact::Provider::VerificationReport

Inherits:
Object
  • Object
show all
Includes:
FileName
Defined in:
lib/pact/provider/verification_report.rb

Instance Method Summary collapse

Methods included from FileName

#file_name, #filenamify

Constructor Details

#initialize(options) ⇒ VerificationReport

Returns a new instance of VerificationReport.



8
9
10
11
12
13
# File 'lib/pact/provider/verification_report.rb', line 8

def initialize (options)
  @consumer = options[:consumer]
  @provider = options[:provider]
  @result = options[:result]
  @output = options[:output]
end

Instance Method Details

#as_json(options = {}) ⇒ Object



24
25
26
# File 'lib/pact/provider/verification_report.rb', line 24

def as_json options = {}
  to_hash
end

#report_file_nameObject



32
33
34
# File 'lib/pact/provider/verification_report.rb', line 32

def report_file_name
  file_name("#{@consumer[:name]}_#{@consumer[:ref]}", "#{@provider[:name]}_#{@provider[:ref]}")
end

#to_hashObject



15
16
17
18
19
20
21
22
# File 'lib/pact/provider/verification_report.rb', line 15

def to_hash
  {
    :consumer => @consumer,
    :provider => @provider,
    :result => @result,
    :output => @output
  }
end

#to_json(options = {}) ⇒ Object



28
29
30
# File 'lib/pact/provider/verification_report.rb', line 28

def to_json(options = {})
  as_json.to_json(options)
end