Class: Webmidi::Message::Channel::ChannelPressure
- Defined in:
- lib/webmidi/message/channel.rb
Instance Attribute Summary collapse
-
#pressure ⇒ Object
readonly
Returns the value of attribute pressure.
Attributes inherited from Base
Attributes inherited from Base
Instance Method Summary collapse
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(pressure:, channel: 0, timestamp: nil) ⇒ ChannelPressure
constructor
A new instance of ChannelPressure.
- #to_bytes ⇒ Object
Methods inherited from Base
#==, #channel, #deconstruct, #eql?, #hash, #same_bytes?, #same_event?, #to_binary, #to_hex, #with
Constructor Details
#initialize(pressure:, channel: 0, timestamp: nil) ⇒ ChannelPressure
Returns a new instance of ChannelPressure.
179 180 181 182 183 184 185 |
# File 'lib/webmidi/message/channel.rb', line 179 def initialize(pressure:, channel: 0, timestamp: nil) validate_channel!(channel) validate_byte!(pressure, "Pressure") @pressure = pressure @channel = channel super(timestamp: ) end |
Instance Attribute Details
#pressure ⇒ Object (readonly)
Returns the value of attribute pressure.
177 178 179 |
# File 'lib/webmidi/message/channel.rb', line 177 def pressure @pressure end |
Instance Method Details
#deconstruct_keys(keys) ⇒ Object
191 192 193 |
# File 'lib/webmidi/message/channel.rb', line 191 def deconstruct_keys(keys) {pressure: @pressure, channel: @channel} end |
#to_bytes ⇒ Object
187 188 189 |
# File 'lib/webmidi/message/channel.rb', line 187 def to_bytes [0xD0 | @channel, @pressure] end |