Exception: RestRedmine::Exception

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/rest_redmine/exception.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, response = nil) ⇒ Exception

Returns a new instance of Exception.



6
7
8
9
# File 'lib/rest_redmine/exception.rb', line 6

def initialize message, response=nil
  @message = message
  @response = response if response
end

Instance Attribute Details

#messageObject



11
12
13
# File 'lib/rest_redmine/exception.rb', line 11

def message
  @message || self.class.name
end

#responseObject

Returns the value of attribute response.



3
4
5
# File 'lib/rest_redmine/exception.rb', line 3

def response
  @response
end

Instance Method Details

#to_sObject



15
16
17
# File 'lib/rest_redmine/exception.rb', line 15

def to_s
  "#{self.class}: #{@message}"
end