Module: Kibosh::Exceptions::Terminal

Class Method Summary collapse

Class Method Details

.included(other) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/kibosh/exceptions.rb', line 26

def self.included other
  (class << other; self; end).send :define_method, :extended do |object|
    body = response = nil
    if Kibosh::Response === object
      response = object
      body = response.body
    else
      body = object
    end
    body["type"] = "terminate"
    body["condition"] = condition
    response and response.status ||= respond_to?(:status) ? status : nil
  end
end