Class: GovukPublishingComponents::AuditComparer

Inherits:
Object
  • Object
show all
Defined in:
app/models/govuk_publishing_components/audit_comparer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(gem_data, results) ⇒ AuditComparer

Returns a new instance of AuditComparer.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/models/govuk_publishing_components/audit_comparer.rb', line 5

def initialize(gem_data, results)
  if gem_data[:gem_found]
    @applications_using_static = %w[
      collections
      email-alert-frontend
      feedback
      finder-frontend
      frontend
      government-frontend
      service-manual-frontend
      smart-answers
    ]

    @static_data = find_static(results)
    @gem_data = gem_data
    @applications_data = sort_results(results)
    @gem_data[:components_by_application] = get_components_by_application || []
    @gem_data[:helpers_used_by_applications] = get_helpers_used_by_applications || []
    @gem_data[:component_file_details] = combine_all_component_file_details(@gem_data[:component_file_details], @applications_data)
  end
end

Instance Attribute Details

#applications_dataObject (readonly)

Returns the value of attribute applications_data.



3
4
5
# File 'app/models/govuk_publishing_components/audit_comparer.rb', line 3

def applications_data
  @applications_data
end

#gem_dataObject (readonly)

Returns the value of attribute gem_data.



3
4
5
# File 'app/models/govuk_publishing_components/audit_comparer.rb', line 3

def gem_data
  @gem_data
end