Class: Unisec::CLI::Commands::Confusables::List

Inherits:
Dry::CLI::Command
  • Object
show all
Defined in:
lib/unisec/cli/confusables.rb

Overview

Command unisec confusables list

Example:

$ unisec confusables list '!'
U+FF01    !    FULLWIDTH EXCLAMATION MARK
U+01C3    ǃ    LATIN LETTER RETROFLEX CLICK
…

Instance Method Summary collapse

Instance Method Details

#call(character: nil, **options) ⇒ Object

List confusables characters for a given character

Parameters:

  • character (String) (defaults to: nil)

    the character to search confusables for

  • options (Hash)

    a customizable set of options

Options Hash (**options):

  • :map (Boolean)

    allows partial mapping, includes confusable where the given chart is a part of



33
34
35
36
# File 'lib/unisec/cli/confusables.rb', line 33

def call(character: nil, **options)
  to_bool = ->(str) { ['true', true].include?(str) }
  Unisec::Confusables.list_display(character, map: to_bool.call(options.fetch(:map)))
end