module BSON::Environment
Provides static helper methods around determining what environment is running without polluting the global namespace.
@since 2.0.0
Public Instance Methods
jruby?()
click to toggle source
Determine if we are using JRuby or not.
@example Are we running with JRuby?
Environment.jruby?
@return [ true, false ] If JRuby is our vm.
@since 2.0.0
# File lib/bson/environment.rb, line 33 def jruby? @jruby ||= defined?(JRUBY_VERSION) end
ruby_1_9?()
click to toggle source
Determine if we are using Ruby version 1.9.
@example Are we running with Ruby version 1.9?
Environment.ruby_1_9?
@return [ true, false ] If the Ruby version is 1.9.
@since 4.2.0 @deprecated
# File lib/bson/environment.rb, line 46 def ruby_1_9? @ruby_1_9 ||= RUBY_VERSION < '2.0.0' end