Class: Apipie::Generator::Swagger::WarningWriter

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/apipie/generator/swagger/warning_writer.rb

Instance Method Summary collapse

Constructor Details

#initializeWarningWriter

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

Returns:

  • (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

Parameters:



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