Module: TextToNoise

Extended by:
TextToNoise
Includes:
Logging
Included in:
TextToNoise
Defined in:
lib/text_to_noise.rb,
lib/text_to_noise/player.rb,
lib/text_to_noise/router.rb,
lib/text_to_noise/logging.rb,
lib/text_to_noise/version.rb,
lib/text_to_noise/log_reader.rb,
lib/text_to_noise/mute_player.rb,
lib/text_to_noise/command_line.rb,
lib/text_to_noise/noise_mapping.rb,
lib/text_to_noise/iteration_mapping_condition.rb

Defined Under Namespace

Modules: Logging Classes: CommandLine, IterationMappingCondition, LogReader, MutePlayer, NoiseMapping, Player, Router

Constant Summary collapse

VERSION =
"0.3.0"

Instance Method Summary collapse

Instance Method Details

#loggerObject



23
24
25
# File 'lib/text_to_noise.rb', line 23

def logger
  @logger ||= Logger.new( STDOUT ).tap { |l| l.level = Logger::INFO }
end

#logger=(logger) ⇒ Object



27
28
29
30
# File 'lib/text_to_noise.rb', line 27

def logger=( logger )
  @logger = logger
  @logger
end

#playerObject



15
16
17
# File 'lib/text_to_noise.rb', line 15

def player
  @player ||= Player.new
end

#player=(player) ⇒ Object



19
20
21
# File 'lib/text_to_noise.rb', line 19

def player=( player )
  @player = player
end

#throttle!Object



36
37
38
39
40
# File 'lib/text_to_noise.rb', line 36

def throttle!
  return unless @delay
  debug "waiting #{@delay}ms (#{@delay / 1_000.0}s)"
  sleep @delay / 1_000.0
end

#throttle_delay=(ms_delay) ⇒ Object



32
33
34
# File 'lib/text_to_noise.rb', line 32

def throttle_delay=( ms_delay )
  @delay = ms_delay
end