mirror of
https://github.com/onyx-and-iris/obsws-ruby.git
synced 2025-04-03 20:03:46 +01:00
Compare commits
2 Commits
aeec0635ca
...
46bfb53db8
Author | SHA1 | Date | |
---|---|---|---|
46bfb53db8 | |||
f669498c69 |
@ -47,10 +47,11 @@ module OBSWS
|
|||||||
end
|
end
|
||||||
|
|
||||||
def remove_observer(observer)
|
def remove_observer(observer)
|
||||||
observers.delete(observer)
|
observer = [observer] unless observer.respond_to? :each
|
||||||
|
observers.reject! { |o| observer.include? o }
|
||||||
end
|
end
|
||||||
|
|
||||||
def notify_observers(event, data)
|
private def notify_observers(event, data)
|
||||||
observers.each do |o|
|
observers.each do |o|
|
||||||
if o.is_a? Method
|
if o.is_a? Method
|
||||||
if o.name.to_s == "on_#{snakecase(event)}"
|
if o.name.to_s == "on_#{snakecase(event)}"
|
||||||
@ -62,6 +63,7 @@ module OBSWS
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
alias_method :callbacks, :observers
|
||||||
alias_method :register, :add_observer
|
alias_method :register, :add_observer
|
||||||
alias_method :deregister, :remove_observer
|
alias_method :deregister, :remove_observer
|
||||||
end
|
end
|
||||||
|
@ -26,11 +26,11 @@ module OBSWS
|
|||||||
def attrs = @fields.map { |f| snakecase(f.to_s) }
|
def attrs = @fields.map { |f| snakecase(f.to_s) }
|
||||||
end
|
end
|
||||||
|
|
||||||
class Response < MetaObject
|
class Response < MetaObject; end
|
||||||
end
|
# Represents a request response object
|
||||||
|
|
||||||
class Data < MetaObject
|
class Data < MetaObject; end
|
||||||
end
|
# Represents an event data object
|
||||||
|
|
||||||
module TearDown
|
module TearDown
|
||||||
def stop_driver
|
def stop_driver
|
||||||
|
@ -11,7 +11,7 @@ module OBSWS
|
|||||||
end
|
end
|
||||||
|
|
||||||
def patch
|
def patch
|
||||||
0
|
1
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_a
|
def to_a
|
||||||
|
Loading…
x
Reference in New Issue
Block a user