From: "jeremyevans0 (Jeremy Evans) via ruby-dev" Date: 2023-10-05T21:21:41+00:00 Subject: [ruby-dev:52050] [Ruby master Feature#18573] Object#pack1 Issue #18573 has been updated by jeremyevans0 (Jeremy Evans). I developed a patch for this that implemented the feature using `Array.pack1` and was going to create a new feature request for it, but I'm glad to see there already is an existing feature request for it. Here's my pull request for it: https://github.com/ruby/ruby/pull/8598 ---------------------------------------- Feature #18573: Object#pack1 https://bugs.ruby-lang.org/issues/18573#change-104824 * Author: os (Shigeki OHARA) * Status: Open * Priority: Normal ---------------------------------------- # ������ String#unpack1 ��������� Object#pack1 ��������������� # ������ Array#pack ������������������������������������������������������������ Array ��������������� 1 ��������������������������������������������� ``` ruby [codepoint].pack('U') [digest].pack('m0') [mail_body].pack('M') [ip_address].pack('N') ``` ������������������������������������������������������������������������������������������ ��������������������������������������������������������������������������������������� Array ������������������������������������������������������������������������������ # ������ String#unpack ������������ String#unpack1 ������������������������������������������ Array#pack ������������ Object#pack1 ������������������������������������������ ��������������������������������������������������������������������� ``` ruby class Object def pack1(template, option = {}) [self].pack(template, **option) end end ``` # ��������������� * Object ��������������������������������������������������������������������� * ������������������ pack1 ������������������������������������������������������������������������������������������ -- https://bugs.ruby-lang.org/