Class: Gitlab::Ci::Lint::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/ci/lint.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(jobs:, merged_yaml:, errors:, warnings:, includes:) ⇒ Result

Returns a new instance of Result.


9
10
11
12
13
14
15
# File 'lib/gitlab/ci/lint.rb', line 9

def initialize(jobs:, merged_yaml:, errors:, warnings:, includes:)
  @jobs = jobs
  @merged_yaml = merged_yaml
  @errors = errors
  @warnings = warnings
  @includes = includes
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.


7
8
9
# File 'lib/gitlab/ci/lint.rb', line 7

def errors
  @errors
end

#includesObject (readonly)

Returns the value of attribute includes.


7
8
9
# File 'lib/gitlab/ci/lint.rb', line 7

def includes
  @includes
end

#jobsObject (readonly)

Returns the value of attribute jobs.


7
8
9
# File 'lib/gitlab/ci/lint.rb', line 7

def jobs
  @jobs
end

#merged_yamlObject (readonly)

Returns the value of attribute merged_yaml.


7
8
9
# File 'lib/gitlab/ci/lint.rb', line 7

def merged_yaml
  @merged_yaml
end

#warningsObject (readonly)

Returns the value of attribute warnings.


7
8
9
# File 'lib/gitlab/ci/lint.rb', line 7

def warnings
  @warnings
end

Instance Method Details

#statusObject


21
22
23
# File 'lib/gitlab/ci/lint.rb', line 21

def status
  valid? ? :valid : :invalid
end

#valid?Boolean

Returns:

  • (Boolean)

17
18
19
# File 'lib/gitlab/ci/lint.rb', line 17

def valid?
  @errors.empty?
end