mirror of
https://github.com/onyx-and-iris/obsws-ruby.git
synced 2025-04-19 19:03:46 +01:00
Compare commits
No commits in common. "a4b70b6a98a42570416fc5ab46bf1b8c451816ac" and "587e861bbefe90050a4c4e6cfbe157ae2bab635c" have entirely different histories.
a4b70b6a98
...
587e861bbe
@ -18,13 +18,10 @@ require_relative "obsws/event"
|
|||||||
require_relative "obsws/version"
|
require_relative "obsws/version"
|
||||||
|
|
||||||
module OBSWS
|
module OBSWS
|
||||||
# Base OBSWS error class
|
|
||||||
class OBSWSError < StandardError; end
|
class OBSWSError < StandardError; end
|
||||||
|
|
||||||
# Raised when a connection fails or times out
|
|
||||||
class OBSWSConnectionError < OBSWSError; end
|
class OBSWSConnectionError < OBSWSError; end
|
||||||
|
|
||||||
# Raised when a request returns an error code
|
|
||||||
class OBSWSRequestError < OBSWSError
|
class OBSWSRequestError < OBSWSError
|
||||||
attr_reader :req_name, :code
|
attr_reader :req_name, :code
|
||||||
|
|
||||||
|
@ -40,12 +40,12 @@ module OBSWS
|
|||||||
end
|
end
|
||||||
|
|
||||||
def register(cbs)
|
def register(cbs)
|
||||||
cbs = Array(cbs) unless cbs.respond_to? :each
|
cbs = [cbs] unless cbs.respond_to? :each
|
||||||
cbs.each { |cb| on(cb.name[3..].to_sym, cb) }
|
cbs.each { |cb| on(cb.name[3..].to_sym, cb) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def deregister(cbs)
|
def deregister(cbs)
|
||||||
cbs = Array(cbs) unless cbs.respond_to? :each
|
cbs = [cbs] unless cbs.respond_to? :each
|
||||||
cbs.each { |cb| observers[cb.name[3..].to_sym]&.reject! { |o| cbs.include? o } }
|
cbs.each { |cb| observers[cb.name[3..].to_sym]&.reject! { |o| cbs.include? o } }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -24,11 +24,11 @@ module OBSWS
|
|||||||
def attrs = @fields.map { |f| snakecase(f.to_s) }
|
def attrs = @fields.map { |f| snakecase(f.to_s) }
|
||||||
end
|
end
|
||||||
|
|
||||||
# Represents a request response object
|
|
||||||
class Response < MetaObject; end
|
class Response < MetaObject; end
|
||||||
|
# Represents a request response object
|
||||||
|
|
||||||
# Represents an event data object
|
|
||||||
class Data < MetaObject; end
|
class Data < MetaObject; 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
|
||||||
1
|
0
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_a
|
def to_a
|
||||||
|
Loading…
x
Reference in New Issue
Block a user