mirror of
https://github.com/onyx-and-iris/voicemeeter-rb.git
synced 2024-11-22 01:40:49 +00:00
use unless over if !
This commit is contained in:
parent
bc9db521fa
commit
917a591956
@ -123,7 +123,7 @@ module Voicemeeter
|
|||||||
public
|
public
|
||||||
|
|
||||||
def get(kind_id)
|
def get(kind_id)
|
||||||
if @loaders.nil?
|
unless defined? @loaders
|
||||||
@loaders = Kinds::ALL.to_h { |kind| [kind.name, Loader.new(kind)] }
|
@loaders = Kinds::ALL.to_h { |kind| [kind.name, Loader.new(kind)] }
|
||||||
@loaders.each { |name, loader| loader.run }
|
@loaders.each { |name, loader| loader.run }
|
||||||
end
|
end
|
||||||
|
@ -81,12 +81,12 @@ module Voicemeeter
|
|||||||
end
|
end
|
||||||
|
|
||||||
def add(events)
|
def add(events)
|
||||||
events = [events] if !events.respond_to? :each
|
events = [events] unless events.respond_to? :each
|
||||||
events.each { |e| send("#{e}=", true) }
|
events.each { |e| send("#{e}=", true) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def remove(events)
|
def remove(events)
|
||||||
events = [events] if !events.respond_to? :each
|
events = [events] unless events.respond_to? :each
|
||||||
events.each { |e| send("#{e}=", false) }
|
events.each { |e| send("#{e}=", false) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -39,7 +39,7 @@ module Voicemeeter
|
|||||||
end
|
end
|
||||||
|
|
||||||
def goto(timestr)
|
def goto(timestr)
|
||||||
if !(timestr =~ /^(2[0-3]|[01]?[0-9]):([0-5]?[0-9]):([0-5]?[0-9])$/)
|
unless /^(2[0-3]|[01]?[0-9]):([0-5]?[0-9]):([0-5]?[0-9])$/.match?(timestr)
|
||||||
logger.error("goto got: '#{timestr}', but expects a time string in the format 'hh:mm:ss'")
|
logger.error("goto got: '#{timestr}', but expects a time string in the format 'hh:mm:ss'")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user