Class: Hash

Inherits:
Object show all
Defined in:
lib/cbor-pp.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#cbor_add_annotations_from(ann_list) ⇒ Object



175
176
177
178
179
180
181
# File 'lib/cbor-pp.rb', line 175

def cbor_add_annotations_from(ann_list)
  super
  each {|k, v|
    # k.cbor_add_annotations_from(ann_list)
    v.cbor_add_annotations_from(ann_list)
  }
end

#cbor_cloneObject



182
183
184
185
186
187
188
# File 'lib/cbor-pp.rb', line 182

def cbor_clone
  # to_a.cbor_clone.to_h  # this breaks for unknown reasons
  h = {}
  each {|k, v| h[k.cbor_clone] = v.cbor_clone}
  each {|k, v| fail [h, k, k.cbor_clone, h[k], v].inspect unless h[k] == v}
  h
end

#cbor_pp(q) ⇒ Object

:nodoc:



172
173
174
# File 'lib/cbor-pp.rb', line 172

def cbor_pp(q) # :nodoc:
  q.pp_hash self, cbor_annotation_format
end