Class: Corundum::QA::Rejection
- Inherits:
-
Object
- Object
- Corundum::QA::Rejection
- Defined in:
- lib/corundum/qa-report.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #file_and_line ⇒ Object
-
#initialize(label, file, line = nil, value = nil) ⇒ Rejection
constructor
A new instance of Rejection.
- #to_s(column_widths = nil) ⇒ Object
Constructor Details
#initialize(label, file, line = nil, value = nil) ⇒ Rejection
Returns a new instance of Rejection.
43 44 45 |
# File 'lib/corundum/qa-report.rb', line 43 def initialize(label, file, line = nil, value = nil) @file, @line, @label, @value = file, line, label, value end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
46 47 48 |
# File 'lib/corundum/qa-report.rb', line 46 def file @file end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
46 47 48 |
# File 'lib/corundum/qa-report.rb', line 46 def label @label end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
46 47 48 |
# File 'lib/corundum/qa-report.rb', line 46 def line @line end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
46 47 48 |
# File 'lib/corundum/qa-report.rb', line 46 def value @value end |
Instance Method Details
#file_and_line ⇒ Object
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/corundum/qa-report.rb', line 48 def file_and_line @file_and_line ||= begin if line.nil? file else [file, line].join(":") end end end |
#to_s(column_widths = nil) ⇒ Object
59 60 61 62 63 64 65 66 67 68 |
# File 'lib/corundum/qa-report.rb', line 59 def to_s(column_widths=nil) column_widths ||= {} [:file_and_line, :label, :value].map do |name| if column_widths.has_key?(name) self.send(name).to_s.ljust(column_widths[name]) else self.send(name).to_s end end.join(' ') end |