Module: TrickSerial::Serializer::ObjectProxy
- Included in:
- ActiveRecordProxy
- Defined in:
- lib/trick_serial/serializer.rb
Defined Under Namespace
Classes: Error
Instance Attribute Summary collapse
-
#cls ⇒ Object
readonly
Returns the value of attribute cls.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#cls ⇒ Object (readonly)
Returns the value of attribute cls.
288 289 290 |
# File 'lib/trick_serial/serializer.rb', line 288 def cls @cls end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
288 289 290 |
# File 'lib/trick_serial/serializer.rb', line 288 def id @id end |
Class Method Details
.included(target) ⇒ Object
290 291 292 |
# File 'lib/trick_serial/serializer.rb', line 290 def self.included target super end |
Instance Method Details
#initialize(obj, serializer) ⇒ Object
294 295 296 |
# File 'lib/trick_serial/serializer.rb', line 294 def initialize obj, serializer self.object = obj end |
#object=(x) ⇒ Object
303 304 305 306 307 |
# File 'lib/trick_serial/serializer.rb', line 303 def object= x # @object = x @cls = x && x.class.name.to_sym @id = x && x.id end |
#resolve_class ⇒ Object
298 299 300 301 |
# File 'lib/trick_serial/serializer.rb', line 298 def resolve_class @resolve_class ||= eval("::#{@cls.to_s}") end |