Class: LLT::Review::Common::Report::Generic

Inherits:
Object
  • Object
show all
Includes:
Helpers::Reportable
Defined in:
lib/llt/review/common/report/generic.rb

Instance Attribute Summary collapse

Attributes included from Helpers::Reportable

#right, #total, #unique, #wrong

Instance Method Summary collapse

Methods included from Helpers::Reportable

#add, #add_total, #add_wrong, #clone, #count_rights, #increment, #init_diff, #percentage, #sort, #sort!

Constructor Details

#initialize(tag, total = 1, reports_to_request = nil) ⇒ Generic

Returns a new instance of Generic.



8
9
10
11
12
13
# File 'lib/llt/review/common/report/generic.rb', line 8

def initialize(tag, total = 1, reports_to_request = nil)
  @tag = tag
  @total = total
  @reports_to_request = reports_to_request
  @container = {}
end

Instance Attribute Details

#reports_to_requestObject (readonly)

Returns the value of attribute reports_to_request.



6
7
8
# File 'lib/llt/review/common/report/generic.rb', line 6

def reports_to_request
  @reports_to_request
end

Instance Method Details

#collect_reports(words) ⇒ Object



27
28
29
# File 'lib/llt/review/common/report/generic.rb', line 27

def collect_reports(words)
  # implemented by including classes
end

#idObject



19
20
21
# File 'lib/llt/review/common/report/generic.rb', line 19

def id
  @tag
end

#xml_attributesObject



15
16
17
# File 'lib/llt/review/common/report/generic.rb', line 15

def xml_attributes
  { total: @total, right: @right, wrong: @wrong, unique: @unique }
end

#xml_tagObject



23
24
25
# File 'lib/llt/review/common/report/generic.rb', line 23

def xml_tag
  @tag
end