Class: EagerRecord::Unmarshallable

Inherits:
Object
  • Object
show all
Defined in:
lib/eager_record/unmarshallable.rb

Overview

A wrapper for objects that we don’t want to marshal. In particular, used to wrap the @originating_collection array that is created in model instances since marshalling that seems a bad idea.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(underlying) ⇒ Unmarshallable

Returns a new instance of Unmarshallable.



18
19
20
# File 'lib/eager_record/unmarshallable.rb', line 18

def initialize(underlying)
  @underlying = underlying
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



22
23
24
# File 'lib/eager_record/unmarshallable.rb', line 22

def method_missing(method, *args, &block)
  @underlying.__send__(method, *args, &block)
end

Class Method Details

._load(dump) ⇒ Object



13
14
15
# File 'lib/eager_record/unmarshallable.rb', line 13

def _load(dump)
  nil
end

Instance Method Details

#_dump(depth) ⇒ Object



30
31
32
# File 'lib/eager_record/unmarshallable.rb', line 30

def _dump(depth)
  Marshal.dump(nil)
end

#respond_to?(method) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/eager_record/unmarshallable.rb', line 26

def respond_to?(method)
  super || @underlying.respond_to?(method)
end