minor syntax changes

This commit is contained in:
onyx-and-iris 2023-07-28 19:05:28 +01:00
parent e4f4961c56
commit 86b84aeef9
2 changed files with 3 additions and 3 deletions

View File

@ -42,7 +42,7 @@ module OBSWS
end end
def add_observer(observer) def add_observer(observer)
observer = [observer] if !observer.respond_to? :each observer = [observer] unless observer.respond_to? :each
observer.each { |o| observers << o unless observers.include? o } observer.each { |o| observers << o unless observers.include? o }
end end

View File

@ -47,12 +47,12 @@ module OBSWS
delay_sec: 0.001, delay_sec: 0.001,
timeout_sec: 3 timeout_sec: 3
) { @response[:requestId] == id } ) { @response[:requestId] == id }
if !@response[:requestStatus][:result] unless @response[:requestStatus][:result]
error = [ error = [
"Request #{@response[:requestType]} returned code #{@response[:requestStatus][:code]}" "Request #{@response[:requestType]} returned code #{@response[:requestStatus][:code]}"
] ]
if @response[:requestStatus].key?(:comment) if @response[:requestStatus].key?(:comment)
error += ["With message: #{@response[:requestStatus][:comment]}"] error << ["With message: #{@response[:requestStatus][:comment]}"]
end end
raise OBSWSError.new(error.join("\n")) raise OBSWSError.new(error.join("\n"))
end end