Class: Gitlab::Metrics::Dashboard::Validator::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/metrics/dashboard/validator/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(content, schema_path, dashboard_path: nil, project: nil) ⇒ Client

dashboard object

Parameters:

  • content (Hash)

    Representing a raw, unprocessed

  • schema_path (String)

    Representing path to dashboard schema file

  • dashboard_path (String) (defaults to: nil)

    Representing path to dashboard content file

  • project (Project) (defaults to: nil)

    Project to validate dashboard against


13
14
15
16
17
18
# File 'lib/gitlab/metrics/dashboard/validator/client.rb', line 13

def initialize(content, schema_path, dashboard_path: nil, project: nil)
  @content = content
  @schema_path = schema_path
  @dashboard_path = dashboard_path
  @project = project
end

Instance Method Details

#executeObject


20
21
22
23
24
25
# File 'lib/gitlab/metrics/dashboard/validator/client.rb', line 20

def execute
  errors = validate_against_schema
  errors += post_schema_validator.validate

  errors.compact
end