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