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.



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

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

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

#reportObject (readonly)

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



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

def report
  @report
end

#urlerObject (readonly)

Returns the value of attribute urler.



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

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



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

def check_against(data_check, **options)
  @options = 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

#nameObject



108
109
110
# File 'lib/lazy/check/checker_code.rb', line 108

def name
  MESSAGES[:CodeToTest]
end

#no_output?Boolean

Returns:

  • (Boolean)


112
113
114
# File 'lib/lazy/check/checker_code.rb', line 112

def no_output?
  options[:return_result] === true
end