Class: Pedalboard::Components::Pot

Inherits:
BaseComponent show all
Defined in:
lib/pedalboard/components/pot.rb

Constant Summary collapse

TOLERANCE =
2
UPPER_LIMIT =
127
LOWER_LIMIT =
0

Instance Attribute Summary collapse

Attributes inherited from BaseComponent

#pedalboard, #pin

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Pot

Returns a new instance of Pot.



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/pedalboard/components/pot.rb', line 19

def initialize opts={}
  super opts

  @change = opts.fetch(:change) { ->(value) {} }
  @lower_limit = opts.fetch(:lower_limit) { LOWER_LIMIT }
  @upper_limit = opts.fetch(:upper_limit) { UPPER_LIMIT }
  @tolerance = opts.fetch(:tolerance) { TOLERANCE }
  @inverted = opts.fetch(:inverted) { false }
  @value = lower_limit

  configure_dino_component
end

Instance Attribute Details

#changeObject (readonly)

Returns the value of attribute change.



13
14
15
# File 'lib/pedalboard/components/pot.rb', line 13

def change
  @change
end

#invertedObject (readonly)

Returns the value of attribute inverted.



13
14
15
# File 'lib/pedalboard/components/pot.rb', line 13

def inverted
  @inverted
end

#lower_limitObject (readonly)

Returns the value of attribute lower_limit.



13
14
15
# File 'lib/pedalboard/components/pot.rb', line 13

def lower_limit
  @lower_limit
end

#toleranceObject (readonly)

Returns the value of attribute tolerance.



13
14
15
# File 'lib/pedalboard/components/pot.rb', line 13

def tolerance
  @tolerance
end

#upper_limitObject (readonly)

Returns the value of attribute upper_limit.



13
14
15
# File 'lib/pedalboard/components/pot.rb', line 13

def upper_limit
  @upper_limit
end

#valueObject

Returns the value of attribute value.



17
18
19
# File 'lib/pedalboard/components/pot.rb', line 17

def value
  @value
end