Class: Pandocomatic::Warning

Inherits:
Object
  • Object
show all
Defined in:
lib/pandocomatic/warning.rb

Overview

A warning given during the conversion process.

Instance Method Summary collapse

Constructor Details

#initialize(message = :unknown, data = nil) ⇒ Warning

Create a new Warning with message and some extra data

Parameters:

  • message (Symbol = :unknown) (defaults to: :unknown)

    the message translation key.

  • data (Object = nil) (defaults to: nil)

    optional data attached to the message.



30
31
32
33
# File 'lib/pandocomatic/warning.rb', line 30

def initialize(message = :unknown, data = nil)
  @message = message
  @data = data
end

Instance Method Details

#data?Boolean

Does this Warning have any data associated with it?

Returns:

  • (Boolean)

    True if there is data attached, false otherwise.



38
39
40
# File 'lib/pandocomatic/warning.rb', line 38

def data?
  !@data.nil?
end