Method: MTP::Properties::Forms::None#unpack

Defined in:
lib/mtp/properties.rb

#unpack(datatype, dts, raw_value) ⇒ Object



142
143
144
145
146
147
148
149
150
# File 'lib/mtp/properties.rb', line 142

def unpack(datatype, dts, raw_value)
  if datatype.name == "String"
    raw_value.unpack("J").first
  elsif (datatype & 0x4000) == 0x4000
    raw_value.unpack("#{dts}+").first
  else
    raw_value.unpack("#{dts}").first
  end
end