Class: Epuber::Epubcheck::Problem

Inherits:
Struct
  • Object
show all
Defined in:
lib/epuber/epubcheck.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#codeObject

Returns the value of attribute code

Returns:

  • (Object)

    the current value of code



19
20
21
# File 'lib/epuber/epubcheck.rb', line 19

def code
  @code
end

#levelObject

Returns the value of attribute level

Returns:

  • (Object)

    the current value of level



19
20
21
# File 'lib/epuber/epubcheck.rb', line 19

def level
  @level
end

#locationObject

Returns the value of attribute location

Returns:

  • (Object)

    the current value of location



19
20
21
# File 'lib/epuber/epubcheck.rb', line 19

def location
  @location
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



19
20
21
# File 'lib/epuber/epubcheck.rb', line 19

def message
  @message
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/epuber/epubcheck.rb', line 36

def error?
  level == :error || level == :fatal
end

#to_sObject

!attribute [r] message

@return [String] message of the problem


32
33
34
# File 'lib/epuber/epubcheck.rb', line 32

def to_s
  "#{level}(#{code}): #{location.path}(#{location.lineno},#{location.column}): #{message}"
end