Module: TrickSerial::Serializer::ProxySwizzlingHash

Includes:
ProxySwizzling
Defined in:
lib/trick_serial/serializer.rb

Overview

module

Instance Method Summary collapse

Instance Method Details

#[](i) ⇒ Object



409
410
411
412
413
414
# File 'lib/trick_serial/serializer.rb', line 409

def [](i)
  if ObjectProxy === (p = super)
    p = self[i] = p.object
  end
  p
end

#eachObject



416
417
418
419
# File 'lib/trick_serial/serializer.rb', line 416

def each
  values
  super
end

#each_pairObject



421
422
423
424
# File 'lib/trick_serial/serializer.rb', line 421

def each_pair 
  values
  super
end

#valuesObject



426
427
428
429
430
431
# File 'lib/trick_serial/serializer.rb', line 426

def values
  keys.to_a.each do | k |
    self[k]
  end
  super
end