Define diff implementations for cruby/jruby

- faster than conditional logic within the methods
- also centralized jruby? predicate