Module: RubyEngine

Defined in:
lib/ruby_engine.rb

Constant Summary collapse

VERSION =
'2.0.0'

Class Method Summary collapse

Class Method Details

.is?(what) ⇒ Boolean Also known as: is

Returns:

  • (Boolean)


9
10
11
# File 'lib/ruby_engine.rb', line 9

def is?(what)
  what === @interpreter
end

.jruby?Boolean Also known as: java?

Returns:

  • (Boolean)


26
27
28
# File 'lib/ruby_engine.rb', line 26

def jruby?
  RubyEngine.is? 'jruby'
end

.mri?Boolean Also known as: official_ruby?, ruby?, cruby?

Returns:

  • (Boolean)


19
20
21
# File 'lib/ruby_engine.rb', line 19

def mri?
  RubyEngine.is? 'ruby'
end

.rubinius?Boolean Also known as: rbx?

Returns:

  • (Boolean)


31
32
33
# File 'lib/ruby_engine.rb', line 31

def rubinius?
  RubyEngine.is? 'rbx'
end

.to_sObject Also known as: inspect



14
15
16
# File 'lib/ruby_engine.rb', line 14

def to_s
  @interpreter.to_s
end

.truffleruby?Boolean Also known as: truffle?

Returns:

  • (Boolean)


36
37
38
# File 'lib/ruby_engine.rb', line 36

def truffleruby?
  RubyEngine.is? 'truffleruby'
end