Class: Git::Lint::Models::Total
- Inherits:
-
Data
- Object
- Data
- Git::Lint::Models::Total
- Defined in:
- lib/git/lint/models/total.rb
Overview
Models totals for reporting purposes.
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#issues ⇒ Object
readonly
Returns the value of attribute issues.
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#warnings ⇒ Object
readonly
Returns the value of attribute warnings.
Instance Method Summary collapse
- #empty? ⇒ Boolean
- #errors? ⇒ Boolean
-
#initialize(items: 0, issues: 0, warnings: 0, errors: 0) ⇒ Total
constructor
A new instance of Total.
- #issues? ⇒ Boolean
- #warnings? ⇒ Boolean
Constructor Details
#initialize(items: 0, issues: 0, warnings: 0, errors: 0) ⇒ Total
Returns a new instance of Total.
8 9 10 |
# File 'lib/git/lint/models/total.rb', line 8 def initialize items: 0, issues: 0, warnings: 0, errors: 0 super end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors
7 8 9 |
# File 'lib/git/lint/models/total.rb', line 7 def errors @errors end |
#issues ⇒ Object (readonly)
Returns the value of attribute issues
7 8 9 |
# File 'lib/git/lint/models/total.rb', line 7 def issues @issues end |
#items ⇒ Object (readonly)
Returns the value of attribute items
7 8 9 |
# File 'lib/git/lint/models/total.rb', line 7 def items @items end |
#warnings ⇒ Object (readonly)
Returns the value of attribute warnings
7 8 9 |
# File 'lib/git/lint/models/total.rb', line 7 def warnings @warnings end |
Instance Method Details
#empty? ⇒ Boolean
12 |
# File 'lib/git/lint/models/total.rb', line 12 def empty? = items.zero? |
#errors? ⇒ Boolean
18 |
# File 'lib/git/lint/models/total.rb', line 18 def errors? = errors.positive? |
#issues? ⇒ Boolean
14 |
# File 'lib/git/lint/models/total.rb', line 14 def issues? = issues.positive? |
#warnings? ⇒ Boolean
16 |
# File 'lib/git/lint/models/total.rb', line 16 def warnings? = warnings.positive? |