Class: Application

Inherits:
BaseObject show all
Defined in:
lib/html_compilation/classes/objects/app.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseObject

#initialize, #set_value

Constructor Details

This class inherits a constructor from BaseObject

Instance Attribute Details

#application_nameObject

Returns the value of attribute application_name.



4
5
6
# File 'lib/html_compilation/classes/objects/app.rb', line 4

def application_name
  @application_name
end

#envObject

Returns the value of attribute env.



4
5
6
# File 'lib/html_compilation/classes/objects/app.rb', line 4

def env
  @env
end

#graphObject

Returns the value of attribute graph.



4
5
6
# File 'lib/html_compilation/classes/objects/app.rb', line 4

def graph
  @graph
end

#pagesObject

Returns the value of attribute pages.



4
5
6
# File 'lib/html_compilation/classes/objects/app.rb', line 4

def pages
  @pages
end

#valuesObject

Returns the value of attribute values.



4
5
6
# File 'lib/html_compilation/classes/objects/app.rb', line 4

def values
  @values
end

Instance Method Details

#calculate_app_scoreObject



6
7
8
9
10
11
12
# File 'lib/html_compilation/classes/objects/app.rb', line 6

def calculate_app_score
  counter = 0
  pages.each do |page|
    counter += page.score
  end
  counter
end

#calculate_total_errorsObject



14
15
16
17
18
19
20
# File 'lib/html_compilation/classes/objects/app.rb', line 14

def calculate_total_errors
  counter = 0
  pages.each do |page|
    counter += page.rows.length
  end
  counter
end

#remove_duplicatesObject



22
23
24
25
26
# File 'lib/html_compilation/classes/objects/app.rb', line 22

def remove_duplicates
  pages.reverse.each do |page|
    page.remove_duplicates(self)
  end
end