You could clean this line up in terms of style a little bit like this:
```
if Object.const_defined?(:Encoding)
```

I would make this block a separate method since you use it again in #candidate_version