mirror of
https://github.com/onyx-and-iris/obsws-ruby.git
synced 2024-11-15 18:50:47 +00:00
minor syntax changes
This commit is contained in:
parent
e4f4961c56
commit
86b84aeef9
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user