Class: Unisec::CLI::Commands::Surrogates::From

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

Overview

Command unisec surrogates from

Example:

$ unisec surrogates from 0xD801 0xDC37
Char: 𐐷
Code Point: 0x10437, 0d66615, 0b10000010000110111
High Surrogate: 0xD801, 0d55297, 0b1101100000000001
Low Surrogate: 0xDC37, 0d56375, 0b1101110000110111

Instance Method Summary collapse

Instance Method Details

#call(high: nil, low: nil) ⇒ Object

Calculate the Unicode code point based on the surrogates.

Parameters:

  • high (String) (defaults to: nil)

    decimal high surrogate

  • low (String) (defaults to: nil)

    decimal low surrogate



34
35
36
37
# File 'lib/unisec/cli/surrogates.rb', line 34

def call(high: nil, low: nil, **)
  puts Unisec::Surrogates.new(Unisec::Utils::String.convert(high, :integer),
                              Unisec::Utils::String.convert(low, :integer)).display
end