mirror of
https://github.com/onyx-and-iris/obsws-ruby.git
synced 2024-11-15 18:50:47 +00:00
refactor
This commit is contained in:
parent
7e580dc91a
commit
a8425cf7cd
13
lib/obsws.rb
13
lib/obsws.rb
@ -25,19 +25,12 @@ module OBSWS
|
||||
class OBSWSRequestError < OBSWSError
|
||||
attr_reader :req_name, :code
|
||||
|
||||
def initialize(req_name, code, msg)
|
||||
def initialize(req_name, code, comment)
|
||||
@req_name = req_name
|
||||
@code = code
|
||||
@msg = msg
|
||||
message = "Request #{req_name} returned code #{code}."
|
||||
message << " With message: #{comment}" if comment
|
||||
super(message)
|
||||
end
|
||||
|
||||
def message
|
||||
msg = [
|
||||
"Request #{@req_name} returned code #{@code}."
|
||||
]
|
||||
msg << "With message: #{@msg}" if @msg
|
||||
msg.join(" ")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user