Class: EWorld::RuleJsParameters

Inherits:
Object
  • Object
show all
Defined in:
lib/rules/js/rule_js_parameters.rb

Class Method Summary collapse

Class Method Details

.run(js_data, errors) ⇒ Object

This rule validate JS method parameters. It checks that the parameters match the actual methods and that we have a description/return type.

Raises:

  • (RuntimeError)


8
9
10
11
12
13
# File 'lib/rules/js/rule_js_parameters.rb', line 8

def self.run(js_data, errors)
    raise RuntimeError, "Expected Array, instead got: #{errors.class}" unless errors.is_a?(Array)
    @errors = errors
    js_data.each { |data| handler(data[1][:file], data[1]) }
    @errors
end