Class: Strumbar::InstrumentList

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/strumbar/configuration.rb

Instance Method Summary collapse

Constructor Details

#initializeInstrumentList

Returns a new instance of InstrumentList.



5
6
7
# File 'lib/strumbar/configuration.rb', line 5

def initialize
  @instruments = []
end

Instance Method Details

#delete(instrument) ⇒ Object



27
28
29
# File 'lib/strumbar/configuration.rb', line 27

def delete instrument
  @instruments.delete_if { |i| i[0] == instrument }
end

#each(&block) ⇒ Object



9
10
11
# File 'lib/strumbar/configuration.rb', line 9

def each &block
  @instruments.each &block
end

#empty?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/strumbar/configuration.rb', line 13

def empty?
  @instruments.empty?
end

#use(instruments, options = {}) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/strumbar/configuration.rb', line 17

def use instruments, options = {}
  if instruments.respond_to? :each
    instruments.each do |instrument|
      add instrument, options
    end
  else
    add instruments, options
  end
end