Class: Lazy::Checker::Code

Inherits:
Object
  • Object
show all
Defined in:
lib/lazy/check/checker_code.rb

Overview

/<< self

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml_code) ⇒ Code

Returns a new instance of Code.



83
84
85
86
# File 'lib/lazy/check/checker_code.rb', line 83

def initialize(xml_code)
  @xml_code = xml_code
  @urler = Checker::Url.new(xml_code)
end

Instance Attribute Details

#reportObject (readonly)

Le rapport courant (pour pouvoir être modifié en cours de test)



81
82
83
# File 'lib/lazy/check/checker_code.rb', line 81

def report
  @report
end

#urlerObject (readonly)

Returns the value of attribute urler.



77
78
79
# File 'lib/lazy/check/checker_code.rb', line 77

def urler
  @urler
end

Instance Method Details

#check_against(data_check, **options) ⇒ Object

Méthode qui procède au check

Parameters:

  • options (Hash)

    :return_result Si true, on retourne les données au lieu de les afficher



93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/lazy/check/checker_code.rb', line 93

def check_against(data_check, **options)
  @report = Reporter.new(self)
  @report.start
  check_case = Checker::CheckCase.new(urler, data_check, @report)
  check_case.check
  @report.end
  if options[:return_result]
    return report
  else
    report.display
  end
end