Module: CBOR::Dcbor::Float_Dcbor_CBOR

Defined in:
lib/cbor-dcbor.rb

Instance Method Summary collapse

Instance Method Details

#cbor_prepare_dcborObject



36
37
38
39
40
41
42
43
# File 'lib/cbor-dcbor.rb', line 36

def cbor_prepare_dcbor
  int = self.to_i
  if int == self && int.to_dcbor.size <= self.to_cbor.size
    int.cbor_prepare_dcbor
  else
    self
  end
end