Exception: MdxTex::ToTextile::InvalidHeaderLevelError

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/mdx_tex/to_textile/errors.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ InvalidHeaderLevelError

Returns a new instance of InvalidHeaderLevelError.



18
19
20
# File 'lib/mdx_tex/to_textile/errors.rb', line 18

def initialize(value)
  super("header_level must be one of #{VALID_HEADER_LEVELS.join(', ')}, got: #{value.inspect}")
end

Class Method Details

.validate!(value) ⇒ Object

Raises:

  • (self)


22
23
24
# File 'lib/mdx_tex/to_textile/errors.rb', line 22

def self.validate!(value)
  raise self, value unless VALID_HEADER_LEVELS.include?(value)
end