class Nice::Diff

Attributes

actual_file[RW]
expected_file[RW]
format[RW]

Public Class Methods

hash_print() click to toggle source
# File lib/nice/diff.rb, line 32
def self.hash_print
    @@hash_print
end
new(format, expected_file, actual_file) click to toggle source
# File lib/nice/diff.rb, line 17
def initialize(format, expected_file, actual_file)                  
    raise Nice::Diff::FileDoesNotExist unless File.exists?(expected_file)
    raise Nice::Diff::FileDoesNotExist unless File.exists?(actual_file)
    raise Nice::Diff::FormatNotSpecified if format.nil?
            
    @expected_file = File.read expected_file
    @actual_file = File.read actual_file
            @format = format.upcase
end

Private Class Methods

print_hash_diff(expected_hash: nil, actual_hash: nil, headers: nil) click to toggle source

Public Instance Methods

key=(key) click to toggle source
# File lib/nice/diff.rb, line 36
def key=(key)
    @@key = key
end
parse_to_array() click to toggle source
# File lib/nice/diff.rb, line 27
def parse_to_array                  
    parser = eval("#{@format}Parser").new
            parser.parse_to_array(self) #passing reference to itself to the parsing strategy
end
print() click to toggle source