Class: TrickSerial::Serializer::ProxySwizzlingIvar

Inherits:
Object
  • Object
show all
Includes:
ProxySwizzling
Defined in:
lib/trick_serial/serializer.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sel, *args, &blk) ⇒ Object



364
365
366
367
368
369
370
371
372
373
# File 'lib/trick_serial/serializer.rb', line 364

def method_missing sel, *args, &blk
  if @owner
    if ObjectProxy === @value
      @value = @value.object
    end
    @owner.instance_variable_set(@name, @value)
    @owner = @name = nil
  end
  @value.__send__(sel, *args, &blk)
end

Instance Method Details

#_proxy_classObject



342
# File 'lib/trick_serial/serializer.rb', line 342

alias :_proxy_class :class

#_proxy_idObject



353
# File 'lib/trick_serial/serializer.rb', line 353

alias :_proxy_id :id

#_proxy_object_idObject



347
# File 'lib/trick_serial/serializer.rb', line 347

alias :_proxy_object_id :object_id

#classObject



343
344
345
# File 'lib/trick_serial/serializer.rb', line 343

def class
  method_missing :class
end

#idObject



355
356
357
# File 'lib/trick_serial/serializer.rb', line 355

def id
  method_missing :id
end

#object_idObject



348
349
350
# File 'lib/trick_serial/serializer.rb', line 348

def object_id
  method_missing :object_id
end