voxpupuli / json-schema

Ruby JSON Schema Validator
MIT License
1.52k stars 242 forks source link

Use self or self.class rather than fully qualified class names #333

Closed iainbeeston closed 7 years ago

iainbeeston commented 8 years ago

In validator.rb and schema.rb there are many places where we refer to the current class explicitly, by it's fully qualified name (eg. JSON::Schema) where instead we could be using self or self.class. I believe using self is cleaner and more obvious, so I propose we change the code to use self.

RST-J commented 7 years ago

It actually changes (I'd say improves) one thing, which I guess isn't really important however: If you have a subclass for which these methods are overridden, it uses the overridden implementation instead of the fully qualified base class' one. I agree with the better readability and hence :+1: