Class: Lrama::Warning
- Inherits:
-
Object
- Object
- Lrama::Warning
- Defined in:
- lib/lrama/warning.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#warns ⇒ Object
readonly
Returns the value of attribute warns.
Instance Method Summary collapse
- #error(message) ⇒ Object
- #has_error? ⇒ Boolean
-
#initialize(out = STDERR) ⇒ Warning
constructor
A new instance of Warning.
- #warn(message) ⇒ Object
Constructor Details
#initialize(out = STDERR) ⇒ Warning
Returns a new instance of Warning.
5 6 7 8 9 |
# File 'lib/lrama/warning.rb', line 5 def initialize(out = STDERR) @out = out @errors = [] @warns = [] end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
3 4 5 |
# File 'lib/lrama/warning.rb', line 3 def errors @errors end |
#warns ⇒ Object (readonly)
Returns the value of attribute warns.
3 4 5 |
# File 'lib/lrama/warning.rb', line 3 def warns @warns end |
Instance Method Details
#error(message) ⇒ Object
11 12 13 14 |
# File 'lib/lrama/warning.rb', line 11 def error() @out << << "\n" @errors << end |
#has_error? ⇒ Boolean
21 22 23 |
# File 'lib/lrama/warning.rb', line 21 def has_error? !@errors.empty? end |
#warn(message) ⇒ Object
16 17 18 19 |
# File 'lib/lrama/warning.rb', line 16 def warn() @out << << "\n" @warns << end |