Class: Webmidi::Message::UMP::Utility
- Inherits:
-
Raw
show all
- Defined in:
- lib/webmidi/message/ump.rb
Instance Attribute Summary
Attributes inherited from Raw
#words
Attributes inherited from Base
#group, #message_type
Attributes inherited from Base
#timestamp
Instance Method Summary
collapse
Methods inherited from Raw
#to_bytes, #with
Methods inherited from Base
#with
Methods inherited from Base
#==, #channel, #deconstruct, #eql?, #hash, #same_bytes?, #same_event?, #to_binary, #to_bytes, #to_hex, #with
Constructor Details
#initialize(words:, group: 0, timestamp: nil) ⇒ Utility
Returns a new instance of Utility.
216
217
218
|
# File 'lib/webmidi/message/ump.rb', line 216
def initialize(words:, group: 0, timestamp: nil)
super(message_type: :utility, words: words, group: group, timestamp: timestamp)
end
|
Instance Method Details
#deconstruct_keys(keys) ⇒ Object
228
229
230
|
# File 'lib/webmidi/message/ump.rb', line 228
def deconstruct_keys(keys)
super.merge(status: status, payload: payload)
end
|
#payload ⇒ Object
224
225
226
|
# File 'lib/webmidi/message/ump.rb', line 224
def payload
@words.first & 0xFFFF
end
|
#status ⇒ Object
220
221
222
|
# File 'lib/webmidi/message/ump.rb', line 220
def status
(@words.first >> 16) & 0xFF
end
|