Class: MIDIMessage::Constant::MessageBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/midi-message/constant.rb

Instance Method Summary collapse

Constructor Details

#initialize(klass, const) ⇒ MessageBuilder

Returns a new instance of MessageBuilder

Parameters:


140
141
142
143
# File 'lib/midi-message/constant.rb', line 140

def initialize(klass, const)
  @klass = klass
  @const = const
end

Instance Method Details

#new(*args) ⇒ Message

Parameters:

  • args (*Object)

Returns:


147
148
149
150
151
# File 'lib/midi-message/constant.rb', line 147

def new(*args)
  args = args.dup
  args.last.kind_of?(Hash) ? args.last[:const] = @const : args.push(:const => @const)
  @klass.new(*args)
end