Class: Shmidi::LedButton
Direct Known Subclasses
Constant Summary collapse
- CTYPE =
:LEDBUT
Instance Attribute Summary collapse
-
#button ⇒ Object
readonly
Returns the value of attribute button.
-
#led ⇒ Object
readonly
Returns the value of attribute led.
Attributes inherited from Control
Attributes included from Base
#_attachments, #_deleted, #_id, #_rev, #version
Instance Method Summary collapse
-
#initialize(id, socket, channel, note, led_note = nil) ⇒ LedButton
constructor
A new instance of LedButton.
Methods inherited from Control
Methods included from Base
#[], #[]=, #clone, #dump, #etag, included, #init, #inspect, #reset, #to_hash, #to_s
Constructor Details
#initialize(id, socket, channel, note, led_note = nil) ⇒ LedButton
7 8 9 10 11 12 13 |
# File 'lib/shmidi/led_button.rb', line 7 def initialize(id, socket, channel, note, led_note = nil) super(id, socket, channel, note) = Button.new(id, socket, channel, note) @led = Led.new(id, socket, channel, led_note || note) .on_press(&lambda { || () }) .on_release(&lambda { || () }) end |
Instance Attribute Details
#button ⇒ Object (readonly)
Returns the value of attribute button.
5 6 7 |
# File 'lib/shmidi/led_button.rb', line 5 def end |
#led ⇒ Object (readonly)
Returns the value of attribute led.
5 6 7 |
# File 'lib/shmidi/led_button.rb', line 5 def led @led end |