Class: Apipie::Generator::Swagger::WarningWriter
- Inherits:
-
Object
- Object
- Apipie::Generator::Swagger::WarningWriter
- Includes:
- Singleton
- Defined in:
- lib/apipie/generator/swagger/warning_writer.rb
Instance Method Summary collapse
- #clear! ⇒ Object
-
#initialize ⇒ WarningWriter
constructor
A new instance of WarningWriter.
- #issued_warnings? ⇒ Boolean
- #warn(warning) ⇒ Object
Constructor Details
#initialize ⇒ WarningWriter
Returns a new instance of WarningWriter.
4 5 6 |
# File 'lib/apipie/generator/swagger/warning_writer.rb', line 4 def initialize @issued_warnings = [] end |
Instance Method Details
#clear! ⇒ Object
21 22 23 24 25 |
# File 'lib/apipie/generator/swagger/warning_writer.rb', line 21 def clear! @issued_warnings = [] self end |
#issued_warnings? ⇒ Boolean
17 18 19 |
# File 'lib/apipie/generator/swagger/warning_writer.rb', line 17 def issued_warnings? @issued_warnings.count > 0 end |
#warn(warning) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/apipie/generator/swagger/warning_writer.rb', line 9 def warn(warning) return if muted_warning?(warning) warning.warn @issued_warnings << warning.id end |