Module: Wasserstand

Defined in:
lib/wasserstand.rb,
lib/wasserstand/level.rb,
lib/wasserstand/trend.rb,
lib/wasserstand/finders.rb,
lib/wasserstand/version.rb,
lib/wasserstand/waterway.rb,
lib/wasserstand/hash_clod.rb,
lib/wasserstand/heap_cache.rb,
lib/wasserstand/null_cache.rb,
lib/wasserstand/commandline.rb,
lib/wasserstand/measurement.rb,
lib/wasserstand/provider/level_mapper.rb,
lib/wasserstand/provider/pegel_online.rb,
lib/wasserstand/provider/waterway_mapper.rb

Defined Under Namespace

Modules: Commandline, Finders, Provider Classes: HashClod, HeapCache, Level, Measurement, NullCache, Trend, Waterway

Constant Summary collapse

AmbigousNameError =
Class.new(StandardError)
IllegalValueError =
Class.new(StandardError)
VERSION =
"0.0.11"

Class Method Summary collapse

Class Method Details

.loggerObject



28
29
30
31
32
33
34
35
# File 'lib/wasserstand.rb', line 28

def logger
  @logger ||= Log4r::Logger.new(self.name).tap do |logger|
    out = Log4r::Outputter.stderr
    out.formatter = Log4r::PatternFormatter.new(:pattern => "%l: %m")
    logger.outputters = out
    logger.level = Log4r::WARN
  end
end

.providerObject



16
17
18
19
20
21
# File 'lib/wasserstand.rb', line 16

def provider
  if @provider.nil?
    self.provider = Provider::PegelOnline.new # go through attribute writer in order to log
  end
  @provider
end

.provider=(p) ⇒ Object



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

def provider=(p)
  Wasserstand.logger.info "Using provider #{p}"
  @provider = p
end