Sha256: 63fafdd7e85a72c8ca129162574ae72283df65ad327aae9814f913311f8c706c

Contents?: true

Size: 642 Bytes

Versions: 7

Compression:

Stored size: 642 Bytes

Contents

As of Ruby 1.9.3, it is impossible to dynamically generate a Symbol
through interpolation without generating garbage. Theoretically, Ruby
should be able to take care of this by building up the String in C and
interning the C String.

Because of this, we avoid generating dynamic Symbols at runtime. For
example, instead of generating the instrumentation event dynamically, we
have a constant with a Hash of events:

```ruby
INSTRUMENT = {
  :serialize => :"serialize.serializer",
  :associations => :"associations.serializer"
}
```

If Ruby ever fixes this issue and avoids generating garbage with dynamic
symbols, this code can be removed.

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
active_model_serializers-0.8.4 cruft.md
active_model_serializers-0.8.3 cruft.md
active_model_serializers-0.8.2 cruft.md
active_model_serializers-0.8.1 cruft.md
active_model_serializers-0.8.0 cruft.md
active_model_serializers-0.7.0 cruft.md
active_model_serializers-0.6.0 cruft.md