Class: ExecJS::ExternalRuntime

Inherits:
Runtime
  • Object
show all
Defined in:
lib/execjs/external_runtime.rb

Defined Under Namespace

Classes: Context

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Runtime

#compile, #context_class, #eval, #exec

Constructor Details

#initialize(options) ⇒ ExternalRuntime

Returns a new instance of ExternalRuntime.



80
81
82
83
84
85
86
87
# File 'lib/execjs/external_runtime.rb', line 80

def initialize(options)
  @name        = options[:name]
  @command     = options[:command]
  @runner_path = options[:runner_path]
  @encoding    = options[:encoding]
  @deprecated  = !!options[:deprecated]
  @binary      = nil
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



78
79
80
# File 'lib/execjs/external_runtime.rb', line 78

def name
  @name
end

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


89
90
91
92
# File 'lib/execjs/external_runtime.rb', line 89

def available?
  require 'json'
  binary ? true : false
end

#deprecated?Boolean

Returns:

  • (Boolean)


94
95
96
# File 'lib/execjs/external_runtime.rb', line 94

def deprecated?
  @deprecated
end