Class: Vastlint::Summary

Inherits:
Object
  • Object
show all
Defined in:
lib/vastlint/summary.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(errors:, warnings:, infos:, valid:) ⇒ Summary

Returns a new instance of Summary.



9
10
11
12
13
14
# File 'lib/vastlint/summary.rb', line 9

def initialize(errors:, warnings:, infos:, valid:)
  @errors = errors
  @warnings = warnings
  @infos = infos
  @valid = valid
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



7
8
9
# File 'lib/vastlint/summary.rb', line 7

def errors
  @errors
end

#infosObject (readonly)

Returns the value of attribute infos.



7
8
9
# File 'lib/vastlint/summary.rb', line 7

def infos
  @infos
end

#warningsObject (readonly)

Returns the value of attribute warnings.



7
8
9
# File 'lib/vastlint/summary.rb', line 7

def warnings
  @warnings
end

Instance Method Details

#as_jsonObject



20
21
22
23
24
25
26
27
# File 'lib/vastlint/summary.rb', line 20

def as_json(*)
  {
    errors: errors,
    warnings: warnings,
    infos: infos,
    valid: valid?
  }
end

#to_hObject



29
30
31
# File 'lib/vastlint/summary.rb', line 29

def to_h
  as_json
end

#to_json(*args) ⇒ Object



33
34
35
# File 'lib/vastlint/summary.rb', line 33

def to_json(*args)
  JSON.generate(as_json, *args)
end

#valid?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/vastlint/summary.rb', line 16

def valid?
  @valid
end