Class: Strumbar::InstrumentList
- Inherits:
-
Object
- Object
- Strumbar::InstrumentList
- Includes:
- Enumerable
- Defined in:
- lib/strumbar/configuration.rb
Instance Method Summary collapse
- #delete(instrument) ⇒ Object
- #each(&block) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize ⇒ InstrumentList
constructor
A new instance of InstrumentList.
- #use(instruments, options = {}) ⇒ Object
Constructor Details
#initialize ⇒ InstrumentList
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
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, = {} if instruments.respond_to? :each instruments.each do |instrument| add instrument, end else add instruments, end end |