Module: Lich::Util::TextStripper::Mode

Defined in:
documented/util/textstripper.rb

Constant Summary collapse

HTML =

Strip HTML tags

:html
XML =

Strip XML tags

:xml
MARKUP =

Strip Markdown/markup formatting

:markup
MARKDOWN =

Alias for MARKUP (both :markup and :markdown are accepted)

:markdown
ALL =
[HTML, XML, MARKUP, MARKDOWN].freeze

Class Method Summary collapse

Class Method Details

.listString

Returns a comma-separated list of valid modes.

Returns:

  • (String)

    a list of valid modes



53
54
55
# File 'documented/util/textstripper.rb', line 53

def self.list
  ALL.join(', ')
end

.valid?(mode) ⇒ Boolean

Checks if the given mode is valid.

Parameters:

  • mode (Symbol, String)

    the mode to validate

Returns:

  • (Boolean)

    true if the mode is valid, false otherwise



47
48
49
# File 'documented/util/textstripper.rb', line 47

def self.valid?(mode)
  ALL.include?(mode.to_sym)
end