From: Michael Bruschkewitz Date: 2010-12-02T18:35:15+09:00 Subject: Re: BitStruct-28bit-Ruby Beginner "Jaikanth Krishnaswamy" schrieb im Newsbeitrag news:0401466efe60cefce55d246c5d9ce4d4@ruby-forum.com... > Hi , > I am a beginner to Ruby. I am using the ruby 1.9.2p0 (2010-08-18 > revision 29036) [i686-linux] and bit-struct (0.13.6) > I am trying to construct a 28 bit length data element in my class > and am getting the following > error./usr/local/ruby/lib/ruby/gems/1.9.1/gems/bit-struct-0.13.6/lib/bit-struct/unsigned-field.rb:244:in > `add_accessors_to': unsupported: Why not use binary string representation: irb(main):019:0> b = "1234".unpack('B*').first => "00110001001100100011001100110100" irb(main):020:0> [b[8..15]].pack 'B*' => "2"