Class: Shmidi::Control

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/shmidi/control.rb

Direct Known Subclasses

Button, Knob, Led, LedButton

Constant Summary

Constants included from Base

Base::CTYPE

Instance Attribute Summary collapse

Attributes included from Base

#_attachments, #_deleted, #_id, #_rev, #version

Instance Method Summary collapse

Methods included from Base

#[], #[]=, #clone, #dump, #etag, included, #init, #inspect, #reset, #to_hash, #to_s

Constructor Details

#initialize(socket, channel, note) ⇒ Control

Returns a new instance of Control.



11
12
13
14
15
# File 'lib/shmidi/control.rb', line 11

def initialize(socket, channel, note)
  @socket = socket
  @channel = channel
  @note = note
end

Instance Attribute Details

#channelObject

Returns the value of attribute channel.



5
6
7
# File 'lib/shmidi/control.rb', line 5

def channel
  @channel
end

#noteObject

Returns the value of attribute note.



5
6
7
# File 'lib/shmidi/control.rb', line 5

def note
  @note
end

Instance Method Details

#idObject



17
18
19
# File 'lib/shmidi/control.rb', line 17

def id
  "#{@channel}:#{@note}"
end

#socketObject



7
8
9
# File 'lib/shmidi/control.rb', line 7

def socket
  Socket[@socket]
end