Class: Ucode::Cli::Lookup
- Inherits:
-
Thor
- Object
- Thor
- Ucode::Cli::Lookup
- Defined in:
- lib/ucode/cli.rb
Overview
─────────────── lookup ───────────────
Instance Method Summary collapse
Instance Method Details
#block(codepoint) ⇒ Object
237 238 239 240 241 242 243 244 245 |
# File 'lib/ucode/cli.rb', line 237 def block(codepoint) cp = parse_cp(codepoint) with_db_handling do result = Commands::LookupCommand.new.lookup_block( VersionResolver.resolve([:version]), codepoint: cp, ) puts "#{format("U+%04X", cp)} → #{result.block || "(unassigned)"}" end end |
#char(codepoint) ⇒ Object
262 263 264 265 266 267 268 269 270 |
# File 'lib/ucode/cli.rb', line 262 def char(codepoint) cp = parse_cp(codepoint) with_db_handling do result = Commands::LookupCommand.new .lookup_char(VersionResolver.resolve([:version]), codepoint: cp, output_root: [:from]) puts "#{format("U+%04X", cp)} block=#{result.block_id} glyph=#{result.glyph_path}" end end |
#script(codepoint) ⇒ Object
249 250 251 252 253 254 255 256 257 |
# File 'lib/ucode/cli.rb', line 249 def script(codepoint) cp = parse_cp(codepoint) with_db_handling do result = Commands::LookupCommand.new.lookup_script( VersionResolver.resolve([:version]), codepoint: cp, ) puts "#{format("U+%04X", cp)} → #{result.script || "(none)"}" end end |