Exception: Voicemeeter::Errors::OutOfBoundsErrors

Inherits:
VMRemoteErrors
  • Object
show all
Defined in:
lib/voicemeeter/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(range) ⇒ OutOfBoundsErrors

Returns a new instance of OutOfBoundsErrors.



28
29
30
# File 'lib/voicemeeter/errors.rb', line 28

def initialize(range)
  self.range = range
end

Instance Attribute Details

#rangeObject

Returns the value of attribute range.



26
27
28
# File 'lib/voicemeeter/errors.rb', line 26

def range
  @range
end

Instance Method Details

#messageObject



32
33
34
35
36
37
38
39
40
# File 'lib/voicemeeter/errors.rb', line 32

def message
  if @range.kind_of?(Range)
    "Value error, expected value in range (#{range.first}..#{range.last})"
  elsif @range.kind_of?(Array)
    "Value error, expected one of: #{@range}"
  else
    "Value error, expected #{@range}"
  end
end