Exception: Pipedrive::PipedriveError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/pipedrive/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, code = nil, data = nil) ⇒ PipedriveError

Returns a new instance of PipedriveError.



7
8
9
10
11
12
# File 'lib/pipedrive/errors.rb', line 7

def initialize(message = nil, code = nil, data = nil)
  super(message)
  @message = message
  @code = code
  @data = data
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



5
6
7
# File 'lib/pipedrive/errors.rb', line 5

def code
  @code
end

#dataObject (readonly)

Returns the value of attribute data.



5
6
7
# File 'lib/pipedrive/errors.rb', line 5

def data
  @data
end

Instance Method Details

#messageObject



14
15
16
17
# File 'lib/pipedrive/errors.rb', line 14

def message
  code_str = @code.nil? ? "" : "(Status #{@code}) "
  "#{code_str}#{@message}"
end