Method: MTP::Properties::Forms::None#pack

Defined in:
lib/mtp/properties.rb

#pack(datatype, dts, value) ⇒ Object



152
153
154
155
156
157
158
159
160
# File 'lib/mtp/properties.rb', line 152

def pack(datatype, dts, value)
  if datatype.name == "String"
    [ value ].pack("J")
  elsif (datatype & 0x4000) == 0x4000
    [ value ].pack("#{dts}+")
  else
    [ value ].pack("#{dts}")
  end
end