Module: ALSA
- Defined in:
- lib/alsa.rb,
lib/alsa.rb,
lib/alsa/logger.rb,
lib/alsa/native.rb,
lib/alsa/version.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
"0.8"
Class Method Summary collapse
Class Method Details
.logger ⇒ Object
2 3 4 5 6 7 8 9 |
# File 'lib/alsa/logger.rb', line 2 def self.logger unless @logger @logger = Logger.new(STDERR) @logger.level = Logger::WARN end @logger end |
.logger=(logger) ⇒ Object
11 |
# File 'lib/alsa/logger.rb', line 11 def self.logger=(logger); @logger = logger; end |
.try_to(message, &block) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/alsa.rb', line 25 def self.try_to(, &block) logger.debug { } if ALSA::Native::error_code?(response = yield) raise "cannot #{} (#{ALSA::Native::strerror(response)})" else response end end |