Exception: Kibosh::Exceptions::Error

Inherits:
Exception
  • Object
show all
Defined in:
lib/kibosh/exceptions.rb

Instance Method Summary collapse

Constructor Details

#initialize(mod, message, session = nil) ⇒ Error

Returns a new instance of Error.



9
10
11
12
13
14
# File 'lib/kibosh/exceptions.rb', line 9

def initialize mod, message, session = nil
  raise "hell" if !(Module === mod)
  super message
  @module = mod
  @session = session
end

Instance Method Details

#extend(response) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/kibosh/exceptions.rb', line 15

def extend response
  response.extend @module
  if message and message !~ /^\s*$/
    body = response.body
    document = body.document
    body.add_child( document.create_element "text" ).add_child(document.create_text_node message)
  end
end