Exception: STP::Errors::STPError

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

Direct Known Subclasses

AccountAlreadyExists

Instance Method Summary collapse

Constructor Details

#initialize(code = nil, message = nil) ⇒ STPError

Returns a new instance of STPError.



4
5
6
7
# File 'lib/stp/errors/stp_error.rb', line 4

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

Instance Method Details

#to_hObject



9
10
11
# File 'lib/stp/errors/stp_error.rb', line 9

def to_h
  { code: @code, message: @message }
end

#to_sObject



13
14
15
# File 'lib/stp/errors/stp_error.rb', line 13

def to_s
  to_h.to_s
end