Exception: RunJS::JavaScriptError

Inherits:
Error
  • Object
show all
Defined in:
lib/runjs/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error, source) ⇒ JavaScriptError

Returns a new instance of JavaScriptError.



22
23
24
25
26
# File 'lib/runjs/error.rb', line 22

def initialize(error, source)
  @error = error
  @source = source
  super(get_message)
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



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

def error
  @error
end

#sourceObject (readonly)

Returns the value of attribute source.



20
21
22
# File 'lib/runjs/error.rb', line 20

def source
  @source
end

Instance Method Details

#[](key) ⇒ Object



28
29
30
31
32
# File 'lib/runjs/error.rb', line 28

def [](key)
  @error[key].nil? ? @error[key.to_s] : @error[key]
rescue
  nil
end